* [PATCH] powerpc32: fix warning from include/linux/mm.h
@ 2014-12-05 11:20 ` Christophe Leroy
0 siblings, 0 replies; 10+ messages in thread
From: Christophe Leroy @ 2014-12-05 11:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, scottwood
Cc: linux-kernel, linuxppc-dev
include/linux/mm.h: In function 'is_vmalloc_addr':
include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return addr >= VMALLOC_START && addr < VMALLOC_END;
^
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
index 234e07c..543bb8e 100644
--- a/arch/powerpc/include/asm/pgtable-ppc32.h
+++ b/arch/powerpc/include/asm/pgtable-ppc32.h
@@ -92,7 +92,7 @@ extern int icache_44x_need_flush;
* system. This really does become a problem for machines with good amounts
* of RAM. -- Cort
*/
-#define VMALLOC_OFFSET (0x1000000) /* 16M */
+#define VMALLOC_OFFSET (0x1000000U) /* 16M */
#ifdef PPC_PIN_SIZE
#define VMALLOC_START (((_ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#else
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] powerpc32: fix warning from include/linux/mm.h
@ 2014-12-05 11:20 ` Christophe Leroy
0 siblings, 0 replies; 10+ messages in thread
From: Christophe Leroy @ 2014-12-05 11:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, scottwood
Cc: linuxppc-dev, linux-kernel
include/linux/mm.h: In function 'is_vmalloc_addr':
include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return addr >= VMALLOC_START && addr < VMALLOC_END;
^
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
index 234e07c..543bb8e 100644
--- a/arch/powerpc/include/asm/pgtable-ppc32.h
+++ b/arch/powerpc/include/asm/pgtable-ppc32.h
@@ -92,7 +92,7 @@ extern int icache_44x_need_flush;
* system. This really does become a problem for machines with good amounts
* of RAM. -- Cort
*/
-#define VMALLOC_OFFSET (0x1000000) /* 16M */
+#define VMALLOC_OFFSET (0x1000000U) /* 16M */
#ifdef PPC_PIN_SIZE
#define VMALLOC_START (((_ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#else
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
2014-12-05 11:20 ` Christophe Leroy
@ 2015-03-20 23:52 ` Scott Wood
-1 siblings, 0 replies; 10+ messages in thread
From: Scott Wood @ 2015-03-20 23:52 UTC (permalink / raw)
To: LEROY Christophe
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, linux-kernel
On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
> include/linux/mm.h: In function 'is_vmalloc_addr':
> include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> return addr >= VMALLOC_START && addr < VMALLOC_END;
> ^
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
That warning doesn't appear to be enabled. What config are you seeing
this with?
I'm also not clear on why this was assigned to me in patchwork.
-Scott
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
@ 2015-03-20 23:52 ` Scott Wood
0 siblings, 0 replies; 10+ messages in thread
From: Scott Wood @ 2015-03-20 23:52 UTC (permalink / raw)
To: LEROY Christophe; +Cc: Paul Mackerras, linuxppc-dev, linux-kernel
On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
> include/linux/mm.h: In function 'is_vmalloc_addr':
> include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> return addr >= VMALLOC_START && addr < VMALLOC_END;
> ^
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
That warning doesn't appear to be enabled. What config are you seeing
this with?
I'm also not clear on why this was assigned to me in patchwork.
-Scott
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
2015-03-20 23:52 ` Scott Wood
@ 2015-04-07 8:07 ` leroy christophe
-1 siblings, 0 replies; 10+ messages in thread
From: leroy christophe @ 2015-04-07 8:07 UTC (permalink / raw)
To: Scott Wood
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, linux-kernel
Le 21/03/2015 00:52, Scott Wood a écrit :
> On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
>> include/linux/mm.h: In function 'is_vmalloc_addr':
>> include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>> return addr >= VMALLOC_START && addr < VMALLOC_END;
>> ^
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> ---
>> arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
> That warning doesn't appear to be enabled. What config are you seeing
> this with?
I'm used to adding EXTRA_CFLAGS=-Wextra when checking my own drivers,
as it helps finding additional bugs.
When doing that, the only warnings I get outside of my own code are this
one, and the other one in my proposed patch identified "powerpc32: fix
warning from include/asm-generic/termios-base.h"
I though it would be worth fixing those two warnings in order to get a
perfectly clean code.
Christophe
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
@ 2015-04-07 8:07 ` leroy christophe
0 siblings, 0 replies; 10+ messages in thread
From: leroy christophe @ 2015-04-07 8:07 UTC (permalink / raw)
To: Scott Wood; +Cc: Paul Mackerras, linuxppc-dev, linux-kernel
Le 21/03/2015 00:52, Scott Wood a écrit :
> On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
>> include/linux/mm.h: In function 'is_vmalloc_addr':
>> include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>> return addr >= VMALLOC_START && addr < VMALLOC_END;
>> ^
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> ---
>> arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
> That warning doesn't appear to be enabled. What config are you seeing
> this with?
I'm used to adding EXTRA_CFLAGS=-Wextra when checking my own drivers,
as it helps finding additional bugs.
When doing that, the only warnings I get outside of my own code are this
one, and the other one in my proposed patch identified "powerpc32: fix
warning from include/asm-generic/termios-base.h"
I though it would be worth fixing those two warnings in order to get a
perfectly clean code.
Christophe
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
2015-04-07 8:07 ` leroy christophe
@ 2015-04-07 21:19 ` Scott Wood
-1 siblings, 0 replies; 10+ messages in thread
From: Scott Wood @ 2015-04-07 21:19 UTC (permalink / raw)
To: leroy christophe
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, linux-kernel
On Tue, 2015-04-07 at 10:07 +0200, leroy christophe wrote:
> Le 21/03/2015 00:52, Scott Wood a écrit :
> > On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
> >> include/linux/mm.h: In function 'is_vmalloc_addr':
> >> include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> >> return addr >= VMALLOC_START && addr < VMALLOC_END;
> >> ^
> >>
> >> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> >> ---
> >> arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> > That warning doesn't appear to be enabled. What config are you seeing
> > this with?
> I'm used to adding EXTRA_CFLAGS=-Wextra when checking my own drivers,
> as it helps finding additional bugs.
It also produces a lot of noise, which is why Linux doesn't enable it.
E.g. it enables useless "unused parameter" warnings all over the place.
> When doing that, the only warnings I get outside of my own code are this
> one, and the other one in my proposed patch identified "powerpc32: fix
> warning from include/asm-generic/termios-base.h"
>
> I though it would be worth fixing those two warnings in order to get a
> perfectly clean code.
In general I don't think we should clutter up the code with suppression
for warnings we don't enable, but in this case we do end up with a value
that would be negative if considered as signed. Instead of changing
VMALLOC_OFFSET, though, I'd address it where the problem is actually
introduced -- which is casting high_memory to (long) rather than
(unsigned long) or (uintptr_t).
-Scott
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
@ 2015-04-07 21:19 ` Scott Wood
0 siblings, 0 replies; 10+ messages in thread
From: Scott Wood @ 2015-04-07 21:19 UTC (permalink / raw)
To: leroy christophe; +Cc: Paul Mackerras, linuxppc-dev, linux-kernel
On Tue, 2015-04-07 at 10:07 +0200, leroy christophe wrote:
> Le 21/03/2015 00:52, Scott Wood a écrit :
> > On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
> >> include/linux/mm.h: In function 'is_vmalloc_addr':
> >> include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> >> return addr >= VMALLOC_START && addr < VMALLOC_END;
> >> ^
> >>
> >> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> >> ---
> >> arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> > That warning doesn't appear to be enabled. What config are you seeing
> > this with?
> I'm used to adding EXTRA_CFLAGS=-Wextra when checking my own drivers,
> as it helps finding additional bugs.
It also produces a lot of noise, which is why Linux doesn't enable it.
E.g. it enables useless "unused parameter" warnings all over the place.
> When doing that, the only warnings I get outside of my own code are this
> one, and the other one in my proposed patch identified "powerpc32: fix
> warning from include/asm-generic/termios-base.h"
>
> I though it would be worth fixing those two warnings in order to get a
> perfectly clean code.
In general I don't think we should clutter up the code with suppression
for warnings we don't enable, but in this case we do end up with a value
that would be negative if considered as signed. Instead of changing
VMALLOC_OFFSET, though, I'd address it where the problem is actually
introduced -- which is casting high_memory to (long) rather than
(unsigned long) or (uintptr_t).
-Scott
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
2015-03-20 23:52 ` Scott Wood
@ 2015-04-08 3:27 ` Michael Ellerman
-1 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2015-04-08 3:27 UTC (permalink / raw)
To: Scott Wood
Cc: LEROY Christophe, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev, linux-kernel
On Fri, 2015-03-20 at 18:52 -0500, Scott Wood wrote:
> On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
> > include/linux/mm.h: In function 'is_vmalloc_addr':
> > include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> > return addr >= VMALLOC_START && addr < VMALLOC_END;
> > ^
> >
> > Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> > ---
> > arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> That warning doesn't appear to be enabled. What config are you seeing
> this with?
>
> I'm also not clear on why this was assigned to me in patchwork.
Because it's from Christophe.
cheers
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: powerpc32: fix warning from include/linux/mm.h
@ 2015-04-08 3:27 ` Michael Ellerman
0 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2015-04-08 3:27 UTC (permalink / raw)
To: Scott Wood; +Cc: Paul Mackerras, linuxppc-dev, linux-kernel
On Fri, 2015-03-20 at 18:52 -0500, Scott Wood wrote:
> On Fri, Dec 05, 2014 at 12:20:20PM +0100, LEROY Christophe wrote:
> > include/linux/mm.h: In function 'is_vmalloc_addr':
> > include/linux/mm.h:367:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> > return addr >= VMALLOC_START && addr < VMALLOC_END;
> > ^
> >
> > Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> > ---
> > arch/powerpc/include/asm/pgtable-ppc32.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> That warning doesn't appear to be enabled. What config are you seeing
> this with?
>
> I'm also not clear on why this was assigned to me in patchwork.
Because it's from Christophe.
cheers
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-04-08 3:27 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05 11:20 [PATCH] powerpc32: fix warning from include/linux/mm.h Christophe Leroy
2014-12-05 11:20 ` Christophe Leroy
2015-03-20 23:52 ` Scott Wood
2015-03-20 23:52 ` Scott Wood
2015-04-07 8:07 ` leroy christophe
2015-04-07 8:07 ` leroy christophe
2015-04-07 21:19 ` Scott Wood
2015-04-07 21:19 ` Scott Wood
2015-04-08 3:27 ` Michael Ellerman
2015-04-08 3:27 ` Michael Ellerman
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.