* [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long
@ 2018-11-17 1:54 Olof Johansson
2018-11-17 2:26 ` Will Deacon
2018-11-19 12:07 ` David Laight
0 siblings, 2 replies; 4+ messages in thread
From: Olof Johansson @ 2018-11-17 1:54 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon
Cc: linux-arm-kernel, linux-kernel, Olof Johansson
Makes sparse happy. Before:
arch/arm64/include/asm/sysreg.h:471:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
arch/arm64/include/asm/sysreg.h:512:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/arm64/include/asm/sysreg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 0c909c4a932ff..981892b67b8f6 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -468,7 +468,7 @@
SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_WXN | \
SCTLR_ELx_DSSBS | ENDIAN_CLEAR_EL2 | SCTLR_EL2_RES0)
-#if (SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != 0xffffffffffffffff
+#if (SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != 0xfffffffffffffffful
#error "Inconsistent SCTLR_EL2 set/clear bits"
#endif
@@ -509,7 +509,7 @@
SCTLR_EL1_UMA | SCTLR_ELx_WXN | ENDIAN_CLEAR_EL1 |\
SCTLR_ELx_DSSBS | SCTLR_EL1_NTWI | SCTLR_EL1_RES0)
-#if (SCTLR_EL1_SET ^ SCTLR_EL1_CLEAR) != 0xffffffffffffffff
+#if (SCTLR_EL1_SET ^ SCTLR_EL1_CLEAR) != 0xfffffffffffffffful
#error "Inconsistent SCTLR_EL1 set/clear bits"
#endif
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long
2018-11-17 1:54 [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long Olof Johansson
@ 2018-11-17 2:26 ` Will Deacon
2018-11-17 2:54 ` Olof Johansson
2018-11-19 12:07 ` David Laight
1 sibling, 1 reply; 4+ messages in thread
From: Will Deacon @ 2018-11-17 2:26 UTC (permalink / raw)
To: Olof Johansson; +Cc: Catalin Marinas, linux-arm-kernel, linux-kernel
Hi Olof,
On Fri, Nov 16, 2018 at 05:54:56PM -0800, Olof Johansson wrote:
> Makes sparse happy. Before:
>
> arch/arm64/include/asm/sysreg.h:471:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
> arch/arm64/include/asm/sysreg.h:512:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> arch/arm64/include/asm/sysreg.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
The warning is bogus imo, but since it's harmless to fix it then we can do
that. However, you've been beaten by:
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-November/613179.html
Will
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long
2018-11-17 2:26 ` Will Deacon
@ 2018-11-17 2:54 ` Olof Johansson
0 siblings, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2018-11-17 2:54 UTC (permalink / raw)
To: Will Deacon
Cc: Catalin Marinas, Linux ARM Mailing List, Linux Kernel Mailing List
On Fri, Nov 16, 2018 at 6:27 PM Will Deacon <will.deacon@arm.com> wrote:
>
> Hi Olof,
>
> On Fri, Nov 16, 2018 at 05:54:56PM -0800, Olof Johansson wrote:
> > Makes sparse happy. Before:
> >
> > arch/arm64/include/asm/sysreg.h:471:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
> > arch/arm64/include/asm/sysreg.h:512:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
> >
> > Signed-off-by: Olof Johansson <olof@lixom.net>
> > ---
> > arch/arm64/include/asm/sysreg.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> The warning is bogus imo, but since it's harmless to fix it then we can do
> that. However, you've been beaten by:
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2018-November/613179.html
Yeah, mostly bogus but still useful to silence warnings so you notice new ones.
Overlooked the duplicate, happy to ack that one instead.
-Olof
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long
2018-11-17 1:54 [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long Olof Johansson
2018-11-17 2:26 ` Will Deacon
@ 2018-11-19 12:07 ` David Laight
1 sibling, 0 replies; 4+ messages in thread
From: David Laight @ 2018-11-19 12:07 UTC (permalink / raw)
To: 'Olof Johansson', Catalin Marinas, Will Deacon
Cc: linux-arm-kernel, linux-kernel
From: Olof Johansson
> Sent: 17 November 2018 01:55
...
> -#if (SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != 0xffffffffffffffff
> +#if (SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != 0xfffffffffffffffful
> #error "Inconsistent SCTLR_EL2 set/clear bits"
> #endif
Wouldn't this be clearer if written:
#if SCTLR_EL2_SET != ~SCTLR_EL2_CLEAR
which then begs the question of why there are separate 'set' and 'clear' masks.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-19 12:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-17 1:54 [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long Olof Johansson
2018-11-17 2:26 ` Will Deacon
2018-11-17 2:54 ` Olof Johansson
2018-11-19 12:07 ` David Laight
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).