* [2.4 patch][5/6] asm-i386/smpboot.h: fix gcc 3.4 compilation
2004-08-26 19:51 [2.4 patch][0/6] fix compile errors with gcc 3.4 Adrian Bunk
@ 2004-08-26 20:04 ` Adrian Bunk
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2004-08-26 20:04 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: linux-kernel
I got the following compile error when trying to build 2.4.28-pre2 using
gcc 3.4:
<-- snip -->
...
gcc-3.4 -D__KERNEL__
-I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon
-fno-unit-at-a-time -nostdinc -iwithprefix include
-DKBUILD_BASENAME=process -c -o process.o process.c
In file included from process.c:47:
/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include/asm/smpboot.h:
In function `target_cpus':
/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include/asm/smpboot.h:133:
error: label at end of compound statement
make[1]: *** [process.o] Error 1
make[1]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/arch/i386/kernel'
<-- snip -->
The patch below fixes this issue.
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
--- linux-2.4.28-pre2-full/include/asm-i386/smpboot.h.old 2004-08-26 19:45:06.000000000 +0200
+++ linux-2.4.28-pre2-full/include/asm-i386/smpboot.h 2004-08-26 19:48:47.000000000 +0200
@@ -130,8 +130,8 @@
cpu = (cpu+1)%smp_num_cpus;
return cpu_to_physical_apicid(cpu);
default:
+ return cpu_online_map;
}
- return cpu_online_map;
}
#else
#define target_cpus() (cpu_online_map)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [2.4 patch][5/6] asm-i386/smpboot.h: fix gcc 3.4 compilation
@ 2004-08-26 20:38 O.Sezer
2004-08-26 22:18 ` Willy Tarreau
0 siblings, 1 reply; 3+ messages in thread
From: O.Sezer @ 2004-08-26 20:38 UTC (permalink / raw)
To: bunk; +Cc: marcelo.tosatti, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 85 bytes --]
Didn't look at the code much but how about removing the
label as the -ac tree does?
[-- Attachment #2: smpboot.patch --]
[-- Type: text/plain, Size: 405 bytes --]
diff -urN 28pre2/include/asm-i386/smpboot.h 28pre2_acx/include/asm-i386/smpboot.h
--- 28pre2/include/asm-i386/smpboot.h 2004-08-08 02:26:06.000000000 +0300
+++ 28pre2_acx/include/asm-i386/smpboot.h 2004-08-26 12:09:44.000000000 +0300
@@ -129,7 +129,6 @@
/*round robin the interrupts*/
cpu = (cpu+1)%smp_num_cpus;
return cpu_to_physical_apicid(cpu);
- default:
}
return cpu_online_map;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.4 patch][5/6] asm-i386/smpboot.h: fix gcc 3.4 compilation
2004-08-26 20:38 [2.4 patch][5/6] asm-i386/smpboot.h: fix gcc 3.4 compilation O.Sezer
@ 2004-08-26 22:18 ` Willy Tarreau
0 siblings, 0 replies; 3+ messages in thread
From: Willy Tarreau @ 2004-08-26 22:18 UTC (permalink / raw)
To: O.Sezer; +Cc: bunk, marcelo.tosatti, linux-kernel
On Thu, Aug 26, 2004 at 11:38:39PM +0300, O.Sezer wrote:
> Didn't look at the code much but how about removing the
> label as the -ac tree does?
>
I remember I once had to add an empty default case in a switch/case in one of
my programs to stop gcc from complaining. I think it is the same here and the
'default' does not harm anyway.
And please remember, as a rule of thumb, if it does not change semantics nor
the code produced, please try to avoid moving parts of the stable kernel.
There are many people who have to apply other patches on top of a vanilla
kernel and who don't like it very much when they get rejects just because
of a recent code "beautification".
Regards,
Willy
> diff -urN 28pre2/include/asm-i386/smpboot.h 28pre2_acx/include/asm-i386/smpboot.h
> --- 28pre2/include/asm-i386/smpboot.h 2004-08-08 02:26:06.000000000 +0300
> +++ 28pre2_acx/include/asm-i386/smpboot.h 2004-08-26 12:09:44.000000000 +0300
> @@ -129,7 +129,6 @@
> /*round robin the interrupts*/
> cpu = (cpu+1)%smp_num_cpus;
> return cpu_to_physical_apicid(cpu);
> - default:
> }
> return cpu_online_map;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-26 22:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-26 20:38 [2.4 patch][5/6] asm-i386/smpboot.h: fix gcc 3.4 compilation O.Sezer
2004-08-26 22:18 ` Willy Tarreau
-- strict thread matches above, loose matches on Subject: below --
2004-08-26 19:51 [2.4 patch][0/6] fix compile errors with gcc 3.4 Adrian Bunk
2004-08-26 20:04 ` [2.4 patch][5/6] asm-i386/smpboot.h: fix gcc 3.4 compilation Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox