diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-04-18 12:04:55 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-04-22 05:08:26 -0400 |
commit | 046982c760bcbb0d92981a7be577dbc081323a78 (patch) | |
tree | 6f804f00cc4183e405691cbda52ac9534ad4be8f /arch/nios2 | |
parent | 921b1f52c942ad2da971c38f54a2045ec7cfe9cb (diff) |
nios2: use correct void* return type for page_to_virt()
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)
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/nios2')
-rw-r--r-- | arch/nios2/include/asm/io.h | 1 | ||||
-rw-r--r-- | arch/nios2/include/asm/page.h | 2 | ||||
-rw-r--r-- | 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) | |||
50 | 50 | ||
51 | /* Pages to physical address... */ | 51 | /* Pages to physical address... */ |
52 | #define page_to_phys(page) virt_to_phys(page_to_virt(page)) | 52 | #define page_to_phys(page) virt_to_phys(page_to_virt(page)) |
53 | #define page_to_bus(page) page_to_virt(page) | ||
54 | 53 | ||
55 | /* Macros used for converting between virtual and physical mappings. */ | 54 | /* Macros used for converting between virtual and physical mappings. */ |
56 | #define phys_to_virt(vaddr) \ | 55 | #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; | |||
84 | ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) | 84 | ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) |
85 | 85 | ||
86 | #define page_to_virt(page) \ | 86 | #define page_to_virt(page) \ |
87 | ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) | 87 | ((void *)(((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) |
88 | 88 | ||
89 | # define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 89 | # define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
90 | # define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && \ | 90 | # 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) | |||
209 | static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | 209 | static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, |
210 | pte_t *ptep, pte_t pteval) | 210 | pte_t *ptep, pte_t pteval) |
211 | { | 211 | { |
212 | unsigned long paddr = page_to_virt(pte_page(pteval)); | 212 | unsigned long paddr = (unsigned long)page_to_virt(pte_page(pteval)); |
213 | 213 | ||
214 | flush_dcache_range(paddr, paddr + PAGE_SIZE); | 214 | flush_dcache_range(paddr, paddr + PAGE_SIZE); |
215 | set_pte(ptep, pteval); | 215 | set_pte(ptep, pteval); |