From patchwork Mon Feb 29 14:44:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63222 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1292822lbc; Mon, 29 Feb 2016 06:49:58 -0800 (PST) X-Received: by 10.66.251.162 with SMTP id zl2mr22805908pac.116.1456757398554; Mon, 29 Feb 2016 06:49:58 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id g7si4852304pat.103.2016.02.29.06.49.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 06:49:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaP7t-0005f1-L1; Mon, 29 Feb 2016 14:48:45 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaP5G-0003RI-7D for linux-arm-kernel@lists.infradead.org; Mon, 29 Feb 2016 14:46:06 +0000 Received: by mail-wm0-x235.google.com with SMTP id n186so52753382wmn.1 for ; Mon, 29 Feb 2016 06:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TXbP9+x3nmF9Eis8/Qk1l3x59KdPh/Ta802ztt1d8ns=; b=aBUudYdfUCDs8M2DG/8ZWPFHzlOckBPaWg4wgaCjb7IcMgLHi3LN7vB/jrKKw0GRBe vCdjmy+3LaIYHyZtGjlN4rr8+Gc3+rjhhV+UPe5NUlzYD1E3KWUtAj3U30AtsVGKuCi5 bJUToYT8Y+tefdcK7aqFvND0VDpxl2egBWRYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TXbP9+x3nmF9Eis8/Qk1l3x59KdPh/Ta802ztt1d8ns=; b=MpAenOzRplqOEFhLkEu8POQFBiVEPxrpzrGmiEBiO6g8uNI+GoXxRpO8EXbgVpB74D 3fFKRZKQvujzez1LteWwxoKoS74RInT6vWm/hQ/tB086k4YiJowYbNfs6rBCnA0/sKfv D+KCQNs60Wbq8zZ+xiqpd81PZFJ2uE8N4RIMFWY0SxPsuU3bPmLr2NJtRGtkGJleOqYl yhOt5PkLOE13opghMGjs8dZD3OdIYbQOnBLkcNNvYDjX129f3eQK5JA1g21kFSmmiudU gKQ/rkfTw+xLXZ8yK9HbVwDQJMXqpx3i8BlPbTG9t22/zhFrPu+esz0lqBK2yL72QVxZ T1CA== X-Gm-Message-State: AD7BkJKpleviUp1IAVWwg/4eGUDtlpde+2Cfujwkgw+BjV5X8at1Be1jgELGlOojcj28hozN X-Received: by 10.194.83.42 with SMTP id n10mr15594352wjy.20.1456757139718; Mon, 29 Feb 2016 06:45:39 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id di1sm26196693wjc.3.2016.02.29.06.45.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 06:45:38 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com Subject: [PATCH v2 7/9] nios2: use correct void* return type for page_to_virt() Date: Mon, 29 Feb 2016 15:44:42 +0100 Message-Id: <1456757084-1078-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456757084-1078-1-git-send-email-ard.biesheuvel@linaro.org> References: <1456757084-1078-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160229_064602_684074_54CC45C9 X-CRM114-Status: GOOD ( 13.27 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:235 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jonas@southpole.se, Ard Biesheuvel , linux-mm@kvack.org, nios2-dev@lists.rocketboards.org, linux@lists.openrisc.net, lftan@altera.com, akpm@linux-foundation.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org To align with other architectures, the expression procuded by expanding the macro page_to_virt() should be of type void*, since it returns a virtual address. Fix that, and also fix up an instance where page_to_virt was expected to return 'unsigned long', and drop another instance that was entirely unused (page_to_bus) Cc: linux-mm@kvack.org Cc: Andrew Morton Cc: Ley Foon Tan Cc: nios2-dev@lists.rocketboards.org Signed-off-by: Ard Biesheuvel --- arch/nios2/include/asm/io.h | 1 - arch/nios2/include/asm/page.h | 2 +- arch/nios2/include/asm/pgtable.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index c5a62da22cd2..ce072ba0f8dd 100644 --- a/arch/nios2/include/asm/io.h +++ b/arch/nios2/include/asm/io.h @@ -50,7 +50,6 @@ static inline void iounmap(void __iomem *addr) /* Pages to physical address... */ #define page_to_phys(page) virt_to_phys(page_to_virt(page)) -#define page_to_bus(page) page_to_virt(page) /* Macros used for converting between virtual and physical mappings. */ #define phys_to_virt(vaddr) \ diff --git a/arch/nios2/include/asm/page.h b/arch/nios2/include/asm/page.h index 4b32d6fd9d98..c1683f51ad0f 100644 --- a/arch/nios2/include/asm/page.h +++ b/arch/nios2/include/asm/page.h @@ -84,7 +84,7 @@ extern struct page *mem_map; ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) #define page_to_virt(page) \ - ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) + ((void *)(((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) # define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) # define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && \ diff --git a/arch/nios2/include/asm/pgtable.h b/arch/nios2/include/asm/pgtable.h index a213e8c9aad0..298393c3cb42 100644 --- a/arch/nios2/include/asm/pgtable.h +++ b/arch/nios2/include/asm/pgtable.h @@ -209,7 +209,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) { - unsigned long paddr = page_to_virt(pte_page(pteval)); + unsigned long paddr = (unsigned long)page_to_virt(pte_page(pteval)); flush_dcache_range(paddr, paddr + PAGE_SIZE); set_pte(ptep, pteval);