From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 7/9] nios2: use correct void* return type for page_to_virt()
Date: Wed, 30 Mar 2016 16:46:02 +0200 [thread overview]
Message-ID: <1459349164-27175-8-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1459349164-27175-1-git-send-email-ard.biesheuvel@linaro.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)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
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(-)
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);
--
2.5.0
next prev parent reply other threads:[~2016-03-30 14:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-30 14:45 [PATCH v2 0/9] arm64: optimize virt_to_page and page_address Ard Biesheuvel
2016-03-30 14:45 ` [PATCH v2 1/9] arm64: vdso: avoid virt_to_page() translations on kernel symbols Ard Biesheuvel
2016-03-30 14:45 ` [PATCH v2 2/9] arm64: mm: free __init memory via the linear mapping Ard Biesheuvel
2016-03-30 14:45 ` [PATCH v2 3/9] arm64: mm: avoid virt_to_page() translation for the zero page Ard Biesheuvel
2016-03-30 14:45 ` [PATCH v2 4/9] arm64: insn: avoid virt_to_page() translations on core kernel symbols Ard Biesheuvel
2016-03-30 14:46 ` [PATCH v2 5/9] arm64: mm: move vmemmap region right below the linear region Ard Biesheuvel
2016-03-30 14:46 ` [PATCH v2 6/9] arm64: mm: restrict virt_to_page() to the linear mapping Ard Biesheuvel
2016-03-30 14:46 ` Ard Biesheuvel [this message]
2016-03-30 14:46 ` [PATCH v2 8/9] openrisc: drop wrongly typed definition of page_to_virt() Ard Biesheuvel
2016-03-30 14:46 ` [PATCH v2 9/9] mm: replace open coded page to virt conversion with page_to_virt() Ard Biesheuvel
2016-04-14 15:25 ` Will Deacon
2016-04-14 15:33 ` Ard Biesheuvel
-- strict thread matches above, loose matches on Subject: below --
2016-02-29 14:44 [PATCH v2 0/9] arm64: optimize virt_to_page and page_address Ard Biesheuvel
2016-02-29 14:44 ` [PATCH v2 7/9] nios2: use correct void* return type for page_to_virt() Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459349164-27175-8-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).