linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [POWERPC] Invalid semicolon after if statement
@ 2007-08-15 22:03 Ilpo Järvinen
  2007-08-16  7:22 ` Geert Uytterhoeven
  2007-08-16  8:08 ` Michael Ellerman
  0 siblings, 2 replies; 6+ messages in thread
From: Ilpo Järvinen @ 2007-08-15 22:03 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1030 bytes --]


A similar fix to netfilter from Eric Dumazet inspired me to
look around a bit by using some grep/sed stuff as looking for
this kind of bugs seemed easy to automate. This is one of them
I found where it looks like this semicolon is not valid.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---

...Since I'm not familiar with these parts of the kernel, you might know 
better than I do if this is stuff is valid...

 arch/powerpc/mm/hash_utils_64.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index f178957..a47151e 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
 
 #ifdef CONFIG_PPC_MM_SLICES
 	/* We only prefault standard pages for now */
-	if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
+	if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
 		return;
 #endif
 
-- 
1.5.0.6

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

* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
  2007-08-15 22:03 [PATCH] [POWERPC] Invalid semicolon after if statement Ilpo Järvinen
@ 2007-08-16  7:22 ` Geert Uytterhoeven
  2007-08-16  8:08 ` Michael Ellerman
  1 sibling, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2007-08-16  7:22 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: linuxppc-dev, paulus

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=UTF-8, Size: 1810 bytes --]

On Thu, 16 Aug 2007, [ISO-8859-1] Ilpo Järvinen wrote:
> A similar fix to netfilter from Eric Dumazet inspired me to
> look around a bit by using some grep/sed stuff as looking for
> this kind of bugs seemed easy to automate. This is one of them
> I found where it looks like this semicolon is not valid.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
> 
> ...Since I'm not familiar with these parts of the kernel, you might know 
> better than I do if this is stuff is valid...
> 
>  arch/powerpc/mm/hash_utils_64.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index f178957..a47151e 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
>  
>  #ifdef CONFIG_PPC_MM_SLICES
>  	/* We only prefault standard pages for now */
> -	if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
> +	if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
>  		return;
>  #endif

Interestingly the test has `unlikely'. So the bug showed up in the `likely'
case...

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:    +32 (0)2 700 8453	
Fax:      +32 (0)2 700 8622	
E-mail:   Geert.Uytterhoeven@sonycom.com	
Internet: http://www.sony-europe.com/
 	
Sony Network and Software Technology Center Europe	
A division of Sony Service Centre (Europe) N.V.	
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium	
VAT BE 0413.825.160 · RPR Brussels	
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619

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

* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
  2007-08-15 22:03 [PATCH] [POWERPC] Invalid semicolon after if statement Ilpo Järvinen
  2007-08-16  7:22 ` Geert Uytterhoeven
@ 2007-08-16  8:08 ` Michael Ellerman
  2007-08-16 14:03   ` Segher Boessenkool
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2007-08-16  8:08 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: linuxppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]

On Thu, 2007-08-16 at 01:03 +0300, Ilpo Järvinen wrote:
> A similar fix to netfilter from Eric Dumazet inspired me to
> look around a bit by using some grep/sed stuff as looking for
> this kind of bugs seemed easy to automate. This is one of them
> I found where it looks like this semicolon is not valid.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
> 
> ...Since I'm not familiar with these parts of the kernel, you might know 
> better than I do if this is stuff is valid...
> 
>  arch/powerpc/mm/hash_utils_64.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index f178957..a47151e 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
>  
>  #ifdef CONFIG_PPC_MM_SLICES
>  	/* We only prefault standard pages for now */
> -	if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
> +	if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
>  		return;
>  #endif

Er yeah that's bad. On kernels with MM_SLICES set we never prefault
anything .. oops ..

And testing confirms that's what's happening, with the semicolon gone we
do prefault somethings.

Thanks to the frickin compiler for warning us, not.

This should probably go to stable for 22 IMHO.

Nice catch Ilpo, perhaps someone should hack sparse to check for that
sort of thing.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
  2007-08-16  8:08 ` Michael Ellerman
@ 2007-08-16 14:03   ` Segher Boessenkool
  2007-08-16 16:40     ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2007-08-16 14:03 UTC (permalink / raw)
  To: michael; +Cc: Ilpo Järvinen, linuxppc-dev, paulus

> Thanks to the frickin compiler for warning us, not.

4.3: "warning: suggest braces around empty body in an 'if' statement"

4.1: "warning: empty body in an if-statement"

Your GCC is too old :-)


Segher

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

* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
  2007-08-16 14:03   ` Segher Boessenkool
@ 2007-08-16 16:40     ` Andreas Schwab
  2007-08-16 23:08       ` Michael Ellerman
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2007-08-16 16:40 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Ilpo Järvinen, paulus, linuxppc-dev

Segher Boessenkool <segher@kernel.crashing.org> writes:

>> Thanks to the frickin compiler for warning us, not.
>
> 4.3: "warning: suggest braces around empty body in an 'if' statement"
>
> 4.1: "warning: empty body in an if-statement"
>
> Your GCC is too old :-)

This warning is only enabled by -Wextra.  Only 4.3 has a separate option
for it (-Wempty-body).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
  2007-08-16 16:40     ` Andreas Schwab
@ 2007-08-16 23:08       ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2007-08-16 23:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Ilpo Järvinen, linuxppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

On Thu, 2007-08-16 at 18:40 +0200, Andreas Schwab wrote:
> Segher Boessenkool <segher@kernel.crashing.org> writes:
> 
> >> Thanks to the frickin compiler for warning us, not.
> >
> > 4.3: "warning: suggest braces around empty body in an 'if' statement"
> >
> > 4.1: "warning: empty body in an if-statement"
> >
> > Your GCC is too old :-)
> 
> This warning is only enabled by -Wextra.  Only 4.3 has a separate option
> for it (-Wempty-body).

Oh good, so in 2011 we'll start getting a warning, sweet.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2007-08-16 23:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 22:03 [PATCH] [POWERPC] Invalid semicolon after if statement Ilpo Järvinen
2007-08-16  7:22 ` Geert Uytterhoeven
2007-08-16  8:08 ` Michael Ellerman
2007-08-16 14:03   ` Segher Boessenkool
2007-08-16 16:40     ` Andreas Schwab
2007-08-16 23:08       ` 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).