From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: ARCH_PFN_OFFSET should be unsigned long
Date: Tue, 28 Oct 2014 12:36:11 +0000 [thread overview]
Message-ID: <20141028123610.GC12136@arm.com> (raw)
In-Reply-To: <1414475041-31480-1-git-send-email-zhangwm@marvell.com>
On Tue, Oct 28, 2014 at 05:44:01AM +0000, Neil Zhang wrote:
> pfns are unsigned long, but PHYS_PFN_OFFSET is phys_addr_t. This leads
> to page_to_pfn() returning phys_addr_t which cause type mismatches in
> some print statements.
Do you have a specific example? Both of those types are 64-bit on arm64.
Will
> Signed-off-by: Neil Zhang <zhangwm@marvell.com>
> ---
> arch/arm64/include/asm/memory.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
> index ccc7087..a62cd07 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -142,7 +142,7 @@ static inline void *phys_to_virt(phys_addr_t x)
> * virt_to_page(k) convert a _valid_ virtual address to struct page *
> * virt_addr_valid(k) indicates whether a virtual address is valid
> */
> -#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
> +#define ARCH_PFN_OFFSET ((unsigned long)PHYS_PFN_OFFSET)
>
> #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
> #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
> --
> 1.7.9.5
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Neil Zhang <zhangwm@marvell.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Catalin Marinas <Catalin.Marinas@arm.com>
Subject: Re: [PATCH] arm64: ARCH_PFN_OFFSET should be unsigned long
Date: Tue, 28 Oct 2014 12:36:11 +0000 [thread overview]
Message-ID: <20141028123610.GC12136@arm.com> (raw)
In-Reply-To: <1414475041-31480-1-git-send-email-zhangwm@marvell.com>
On Tue, Oct 28, 2014 at 05:44:01AM +0000, Neil Zhang wrote:
> pfns are unsigned long, but PHYS_PFN_OFFSET is phys_addr_t. This leads
> to page_to_pfn() returning phys_addr_t which cause type mismatches in
> some print statements.
Do you have a specific example? Both of those types are 64-bit on arm64.
Will
> Signed-off-by: Neil Zhang <zhangwm@marvell.com>
> ---
> arch/arm64/include/asm/memory.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
> index ccc7087..a62cd07 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -142,7 +142,7 @@ static inline void *phys_to_virt(phys_addr_t x)
> * virt_to_page(k) convert a _valid_ virtual address to struct page *
> * virt_addr_valid(k) indicates whether a virtual address is valid
> */
> -#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
> +#define ARCH_PFN_OFFSET ((unsigned long)PHYS_PFN_OFFSET)
>
> #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
> #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
> --
> 1.7.9.5
>
>
next prev parent reply other threads:[~2014-10-28 12:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 5:44 [PATCH] arm64: ARCH_PFN_OFFSET should be unsigned long Neil Zhang
2014-10-28 5:44 ` Neil Zhang
2014-10-28 12:36 ` Will Deacon [this message]
2014-10-28 12:36 ` Will Deacon
2014-10-28 12:51 ` Arnd Bergmann
2014-10-28 12:51 ` Arnd Bergmann
2014-10-28 13:36 ` Will Deacon
2014-10-28 13:36 ` Will Deacon
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=20141028123610.GC12136@arm.com \
--to=will.deacon@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.