From: yingjie_bai@126.com
To: Scott Wood <oss@buserror.net>, Kumar Gala <galak@kernel.crashing.org>
Cc: Bai Yingjie <byj.tea@gmail.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Christophe Leroy <christophe.leroy@c-s.fr>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
Diana Craciun <diana.craciun@nxp.com>,
Jason Yan <yanaijie@huawei.com>,
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
Nicholas Piggin <npiggin@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Allison Randal <allison@lohutok.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/2] powerpc32/booke: consistently return phys_addr_t in __pa()
Date: Mon, 30 Dec 2019 15:26:19 +0800 [thread overview]
Message-ID: <20191230072623.25353-1-yingjie_bai@126.com> (raw)
From: Bai Yingjie <byj.tea@gmail.com>
When CONFIG_RELOCATABLE=y is set, VIRT_PHYS_OFFSET is a 64bit variable,
thus __pa() returns as 64bit value.
But when CONFIG_RELOCATABLE=n, __pa() returns 32bit value.
We'd make __pa() consistently return phys_addr_t, even if the upper bits
are known to always be zero in a particular config.
Signed-off-by: Bai Yingjie <byj.tea@gmail.com>
---
arch/powerpc/include/asm/page.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 7f1fd41e3065..86332080399a 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -209,7 +209,7 @@ static inline bool pfn_valid(unsigned long pfn)
*/
#if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE)
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
-#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
+#define __pa(x) ((phys_addr_t)(unsigned long)(x) - VIRT_PHYS_OFFSET)
#else
#ifdef CONFIG_PPC64
/*
--
2.17.1
next reply other threads:[~2019-12-30 7:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-30 7:26 yingjie_bai [this message]
2019-12-30 7:26 ` [PATCH v2 2/2] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry yingjie_bai
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=20191230072623.25353-1-yingjie_bai@126.com \
--to=yingjie_bai@126.com \
--cc=allison@lohutok.net \
--cc=aneesh.kumar@linux.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=byj.tea@gmail.com \
--cc=christophe.leroy@c-s.fr \
--cc=diana.craciun@nxp.com \
--cc=galak@kernel.crashing.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=nsaenzjulienne@suse.de \
--cc=oss@buserror.net \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
--cc=yanaijie@huawei.com \
/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).