From patchwork Mon Apr 18 16:04:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 66046 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1368214qge; Mon, 18 Apr 2016 09:06:16 -0700 (PDT) X-Received: by 10.98.82.194 with SMTP id g185mr23938398pfb.157.1460995576076; Mon, 18 Apr 2016 09:06:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si4075426pfb.182.2016.04.18.09.06.15; Mon, 18 Apr 2016 09:06:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752961AbcDRQGN (ORCPT + 29 others); Mon, 18 Apr 2016 12:06:13 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:38589 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752592AbcDRQFG (ORCPT ); Mon, 18 Apr 2016 12:05:06 -0400 Received: by mail-wm0-f48.google.com with SMTP id u206so131485723wme.1 for ; Mon, 18 Apr 2016 09:05:06 -0700 (PDT) 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=5n0bwB4dt/eEsJktMU4SYhC0cIR9SeJs65rPJm1C8BE=; b=iQ4GkX6ypLkaFeBjxEFNWDSUGkXYkOll2mw8FVu5zZehLpEEyV4f87jVUolzM56UeJ EpplUaly7gvO4cWRaR8Y0QJVqqd0FfHz7CYwGsEcfzHLZHudJbsKFvGcAC0DbRtHn1vu ETz7YEjgWOr9j7X+vn2ZxFKG9JwmQOmYmP0as= 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=5n0bwB4dt/eEsJktMU4SYhC0cIR9SeJs65rPJm1C8BE=; b=BWYeJVt+3USY36u9WcylQYEQIdKNF9RBomMuVKtYaMXLd5by9aQxPL5dXmJkW3W1OB k4jXMVhrUGjQTHeWvAWa7rL+VAZk0No/+bP2PdxvLl1GDVyrYHsLDOZLZxUSsn350+7t whlK79Z21l1IiA0RGnjTvGa+u9Ytqe9tSeir/P6HYNEqykWcsAagjGZi99r3VD3NqIEG hi0xjDawkOmJqbt+M7ESKqXpM9EUdny3+vIwT9H/dTIjhh5WRsgcX0ffq99KcGLh0fTJ Kowo3JSXQLo6QTscaikVwh2bu5KVd13RrYQbv9kc44b855hp8ck6kAWft4bNMfoEWgdM FgIg== X-Gm-Message-State: AOPr4FXYZgfFbO6tb855cIA0Mjl/owUaqnjbUeeAPYhfwTGbG7SvbqyNZj/kgje7Ic5V9+Tv X-Received: by 10.28.47.210 with SMTP id v201mr20106206wmv.56.1460995505153; Mon, 18 Apr 2016 09:05:05 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id e12sm27231198wma.15.2016.04.18.09.05.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Apr 2016 09:05:04 -0700 (PDT) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, lftan@altera.com, jonas@southpole.se Cc: will.deacon@arm.com, Ard Biesheuvel Subject: [PATCH resend 1/3] nios2: use correct void* return type for page_to_virt() Date: Mon, 18 Apr 2016 18:04:55 +0200 Message-Id: <1460995497-24312-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460995497-24312-1-git-send-email-ard.biesheuvel@linaro.org> References: <1460995497-24312-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To align with other architectures, the expression produced 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) 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 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);