Skip to content

Commit 046982c

Browse files
Ard Biesheuvelwildea01
authored andcommitted
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>
1 parent 921b1f5 commit 046982c

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

arch/nios2/include/asm/io.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ static inline void iounmap(void __iomem *addr)
5050

5151
/* Pages to physical address... */
5252
#define page_to_phys(page) virt_to_phys(page_to_virt(page))
53-
#define page_to_bus(page) page_to_virt(page)
5453

5554
/* Macros used for converting between virtual and physical mappings. */
5655
#define phys_to_virt(vaddr) \

arch/nios2/include/asm/page.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extern struct page *mem_map;
8484
((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
8585

8686
#define page_to_virt(page) \
87-
((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
87+
((void *)(((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
8888

8989
# define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
9090
# define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && \

arch/nios2/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval)
209209
static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
210210
pte_t *ptep, pte_t pteval)
211211
{
212-
unsigned long paddr = page_to_virt(pte_page(pteval));
212+
unsigned long paddr = (unsigned long)page_to_virt(pte_page(pteval));
213213

214214
flush_dcache_range(paddr, paddr + PAGE_SIZE);
215215
set_pte(ptep, pteval);

0 commit comments

Comments
 (0)