Linus,
Please consider below patch for inclusion. It fixes compiler warnings
from arch/i386/kernel/bluesmoke.c which appear due to smp_call_function
expecting a function pointer taking an argument to a void * but
mce_checkregs takes an int argument...
This patch changes mce_checkregs to use void* and typecasts to/from
unsigned long as necessary.
Patch is tested and compilation of bluesmoke.c now proceeds without
warnings on both UP and SMP.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
--- mce.patch ---
--- tng/arch/i386/kernel/bluesmoke.c.old Fri Apr 19 10:54:21 2002
+++ tng/arch/i386/kernel/bluesmoke.c Fri Apr 19 10:53:04 2002
@@ -227,12 +227,12 @@ asmlinkage void do_machine_check(struct
#ifdef CONFIG_X86_MCE_NONFATAL
struct timer_list mce_timer;
-static void mce_checkregs (unsigned int cpu)
+static void mce_checkregs (void *cpu)
{
u32 low, high;
int i;
- if (cpu!=smp_processor_id())
+ if ((unsigned long)cpu!=smp_processor_id())
BUG();
for (i=0; i<banks; i++) {
@@ -258,13 +258,13 @@ static void mce_checkregs (unsigned int
static void mce_timerfunc (unsigned long data)
{
- int i;
+ unsigned long i;
- for (i=0; i<smp_num_cpus; i++) {
+ for (i = 0; i < smp_num_cpus; i++) {
if (i == smp_processor_id())
- mce_checkregs(i);
+ mce_checkregs((void*)i);
else
- smp_call_function (mce_checkregs, i, 1, 1);
+ smp_call_function(mce_checkregs, (void*)i, 1, 1);
}
}
#endif
On Fri, Apr 19, 2002 at 11:18:05AM +0100, Anton Altaparmakov wrote:
> Please consider below patch for inclusion. It fixes compiler warnings
> from arch/i386/kernel/bluesmoke.c which appear due to smp_call_function
> expecting a function pointer taking an argument to a void * but
> mce_checkregs takes an int argument...
Robert Love's patch to fix these up did it with less unnecessary casts,
and seems to be ok in my testing.
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/linux-dj/linux-2.5/arch/i386/kernel/bluesmoke.c
(This contains some other bits too that I intend to push to Linus after
a pre1 appears)
Dave.
--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs
At 14:00 19/04/02, Dave Jones wrote:
>On Fri, Apr 19, 2002 at 11:18:05AM +0100, Anton Altaparmakov wrote:
> > Please consider below patch for inclusion. It fixes compiler warnings
> > from arch/i386/kernel/bluesmoke.c which appear due to smp_call_function
> > expecting a function pointer taking an argument to a void * but
> > mce_checkregs takes an int argument...
>
>Robert Love's patch to fix these up did it with less unnecessary casts,
>and seems to be ok in my testing.
>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/linux-dj/linux-2.5/arch/i386/kernel/bluesmoke.c
Yes this is nicer (sorry must have missed the patch), even though this bit
unnecessary:
<snip, line 228 in above file:>
unsigned int *cpu = info;
BUG_ON (*cpu != smp_processor_id());
<snip>
If gcc optimizes the "cpu" into a register then fine but if not, it would
be IMHO preferable to use this instead:
BUG_ON(*(unsigned int *)info != smp_processor_id());
>(This contains some other bits too that I intend to push to Linus after
> a pre1 appears)
Why not push now considering 2.5.9 isn't out yet?
Considering the current bitkeeper tree on bkbits does not compile on ia32
UP at all by any close margin, the more fixes that go in now the better...
I spent two hours this morning try to get it to compile on UP but I got
stuck in arch/i386/kernel/msr.c: gcc complains about cpu_data not being
defined even though the right include file is included. Obviously a nasty
out of scope included headers interdependency which I haven't managed to see...
And adding to that that the ia32 SMP compiled kernel doesn't manage to boot
on my machine yet (as of this morning, containing up to IDE39 patch still
didn't boot due to hanging after detecting hda but before hdc as I have
reported before).
Releasing 2.5.9 in current state would not be too useful for people like me
who experience the ide problems...
Best regards,
Anton
--
"I've not lost my mind. It's backed up on tape somewhere." - Unknown
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
On Fri, Apr 19, 2002 at 03:16:32PM +0100, Anton Altaparmakov wrote:
> If gcc optimizes the "cpu" into a register then fine but if not, it would
> be IMHO preferable to use this instead:
>
> BUG_ON(*(unsigned int *)info != smp_processor_id());
I favoured simplicity over optimisation here, as it's not a speed critical path.
> >(This contains some other bits too that I intend to push to Linus after
> > a pre1 appears)
> Why not push now considering 2.5.9 isn't out yet?
I've not pulled Linus' bk tree, but have noticed from the changelogs
that some changes went in already touching this file.
> Considering the current bitkeeper tree on bkbits does not compile on ia32
> UP at all by any close margin, the more fixes that go in now the better...
Erk.
> Releasing 2.5.9 in current state would not be too useful for people like me
> who experience the ide problems...
Agreed. I assumed the Linus just didn't add the "pre1" part to EXTRAVERSION
yet but, given that 2.5.8 doesn't compile for a lot of people, I can see
why pushing 2.5.9 out sooner would be a good thing.
I've been busy with x86-64 bits and other projects the last few days, I'll
continue pushing more bits from my tree (including the bluesmoke bits) to
Linus over the weekend.
Dave.
--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs