Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382320

Re: [PATCH resend 1/3] nios2: use correct void* return type for page_to_virt()

From Ley Foon Tan <lftan@altera.com>
Newsgroups linux.kernel
Subject Re: [PATCH resend 1/3] nios2: use correct void* return type for page_to_virt()
Date 2016-04-19 11:40 +0200
Message-ID <rpAiu-4BY-1@gated-at.bofh.it> (permalink)
References <rpjUm-8sp-11@gated-at.bofh.it> <rpjUm-8sp-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 19, 2016 at 12:04 AM, Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> 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 <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);
> --
Acked-by: Ley Foon Tan <lftan@altera.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH resend 0/3] mm: allow arch to override lowmem_page_address Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-04-18 18:10 +0200
  [PATCH resend 1/3] nios2: use correct void* return type for page_to_virt() Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-04-18 18:10 +0200
    Re: [PATCH resend 1/3] nios2: use correct void* return type for page_to_virt() Ley Foon Tan <lftan@altera.com> - 2016-04-19 11:40 +0200
  Re: [PATCH resend 0/3] mm: allow arch to override lowmem_page_address Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-04-18 18:10 +0200
  [PATCH resend 3/3] mm: replace open coded page to virt conversion with page_to_virt() Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-04-18 18:10 +0200
  Re: [PATCH resend 0/3] mm: allow arch to override  lowmem_page_address Andrew Morton <akpm@linux-foundation.org> - 2016-04-22 02:00 +0200
    Re: [PATCH resend 0/3] mm: allow arch to override lowmem_page_address Will Deacon <will.deacon@arm.com> - 2016-04-22 11:10 +0200

csiph-web