linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: mark 64-bit PD_HUGE constant as unsigned long
@ 2018-11-06 14:48 Daniel Axtens
  2018-11-27  9:22 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Axtens @ 2018-11-06 14:48 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Daniel Axtens

When compiled for 64-bit, the PD_HUGE constant is a 64-bit integer.
Mark it as an unsigned long.

This squashes over a thousand sparse warnings on my minimal T4240RDB
(e6500, ppc64be) config, of the following 2 forms:

arch/powerpc/include/asm/hugetlb.h:52:49: warning: constant 0x8000000000000000 is so big it is unsigned long
arch/powerpc/include/asm/nohash/pgtable.h:269:49: warning: constant 0x8000000000000000 is so big it is unsigned long

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

Boot tested on a T4240RDB.
---
 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 f6a1265face2..9ea903221a9f 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -289,7 +289,7 @@ static inline bool pfn_valid(unsigned long pfn)
  * page tables at arbitrary addresses, this breaks and will have to change.
  */
 #ifdef CONFIG_PPC64
-#define PD_HUGE 0x8000000000000000
+#define PD_HUGE 0x8000000000000000UL
 #else
 #define PD_HUGE 0x80000000
 #endif
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: powerpc: mark 64-bit PD_HUGE constant as unsigned long
  2018-11-06 14:48 [PATCH] powerpc: mark 64-bit PD_HUGE constant as unsigned long Daniel Axtens
@ 2018-11-27  9:22 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-11-27  9:22 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev; +Cc: Daniel Axtens

On Tue, 2018-11-06 at 14:48:03 UTC, Daniel Axtens wrote:
> When compiled for 64-bit, the PD_HUGE constant is a 64-bit integer.
> Mark it as an unsigned long.
> 
> This squashes over a thousand sparse warnings on my minimal T4240RDB
> (e6500, ppc64be) config, of the following 2 forms:
> 
> arch/powerpc/include/asm/hugetlb.h:52:49: warning: constant 0x8000000000000000 is so big it is unsigned long
> arch/powerpc/include/asm/nohash/pgtable.h:269:49: warning: constant 0x8000000000000000 is so big it is unsigned long
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/d456f3529a7a980ca7410c62e9e349

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-27  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 14:48 [PATCH] powerpc: mark 64-bit PD_HUGE constant as unsigned long Daniel Axtens
2018-11-27  9:22 ` Michael Ellerman

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).