[PATCH] [POWERPC] Invalid semicolon after if statement

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE6933d

6 messages, 5 authors, 2007-08-16 · open the first message on its own page

[PATCH] [POWERPC] Invalid semicolon after if statement

From: Ilpo Järvinen <hidden>
Date: 2007-08-15 22:08:53

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 <redacted>
---

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

Re: [PATCH] [POWERPC] Invalid semicolon after if statement

From: Geert Uytterhoeven <hidden>
Date: 2007-08-16 07:22:07

On Thu, 16 Aug 2007, [ISO-8859-1] Ilpo J�rvinen wrote:
quoted hunk
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 <redacted>
---

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

Re: [PATCH] [POWERPC] Invalid semicolon after if statement

From: Michael Ellerman <hidden>
Date: 2007-08-16 08:08:22

On Thu, 2007-08-16 at 01:03 +0300, Ilpo Järvinen wrote:
quoted hunk
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 <redacted>
---

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

Re: [PATCH] [POWERPC] Invalid semicolon after if statement

From: Segher Boessenkool <hidden>
Date: 2007-08-16 14:03:47

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

Re: [PATCH] [POWERPC] Invalid semicolon after if statement

From: Andreas Schwab <hidden>
Date: 2007-08-16 16:40:34

Segher Boessenkool [off-list ref] writes:
quoted
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."

Re: [PATCH] [POWERPC] Invalid semicolon after if statement

From: Michael Ellerman <hidden>
Date: 2007-08-16 23:08:25

On Thu, 2007-08-16 at 18:40 +0200, Andreas Schwab wrote:
Segher Boessenkool [off-list ref] writes:
quoted
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help