Minor "cleanup" patches for 2.4.5-ac kernels

Minor "cleanup" patches for 2.4.5-ac kernels

Post by Michal Jaegerman » Thu, 14 Jun 2001 09:50:06



Here are some small, but in times important, "gotchas" in current
2.4.5-ac kernels.

When compiling SMP 'udelay' in current drivers/pci/quirks.c expands to:

   __udelay((15), cpu_data[(current->processor)]...

and a type for 'current' is not known, at least on alpha, so
the following seems to be in order:

--- linux-2.4.5ac/drivers/pci/quirks.c~ Tue Jun 12 16:31:12 2001

 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/sched.h>

 #undef DEBUG

There is no problem if SMP is not configured.

This one is replacing a symbol in sg.c to one which is exported
so 'sg.o' can be compiled as a valid module.

--- linux-2.4.5ac/drivers/scsi/sg.c~    Tue May 29 17:52:09 2001

     num = (count < 10) ? count : 10;
     copy_from_user(buff, buffer, num);
     buff[num] = '\0';
-    sg_allow_dio = simple_strtol(buff, 0, 10) ? 1 : 0;
+    sg_allow_dio = simple_strtoul(buff, 0, 10) ? 1 : 0;
     return count;
 }

And this one, proposed already some few times by Ivan Kokshaysky,

--- 2.4.5-ac11/include/linux/binfmts.h  Mon Jun  4 14:19:00 2001

        unsigned long loader, exec;
 };

+/* Forward declaration */
+struct mm_struct;
+
 /*
  * This structure defines the functions that are used to load the binary formats that
  * linux accepts.

kills a flood of warnings (at least on Alpha) about 'mm_struct'
defined on a parameter list.

Are there any reasons which would make any of those "bad"?

  Michal
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Minor "cleanup" patches for 2.4.5-ac kernels

Post by Jeff Garzi » Thu, 14 Jun 2001 10:10:12



> --- linux-2.4.5ac/drivers/pci/quirks.c~ Tue Jun 12 16:31:12 2001
> +++ linux-2.4.5ac/drivers/pci/quirks.c  Tue Jun 12 17:13:18 2001

>  #include <linux/pci.h>
>  #include <linux/init.h>
>  #include <linux/delay.h>
> +#include <linux/sched.h>

>  #undef DEBUG

> There is no problem if SMP is not configured.

no the better place for this is include/asm-i386/delay.h.  Otherwise you
wind up solving the same problem over and over again in each similar
driver.

I --just-- went through on Alpha, and included linux/sched.h in
include/asm-alpha/delay.h.  Not an hour ago :)  Then Andrea suggested to
simply un-inline udelay, which solved the compile problem in an even
better way.  (we cannot un-inline udelay on x86 I think)

> --- 2.4.5-ac11/include/linux/binfmts.h  Mon Jun  4 14:19:00 2001
> +++ linux/include/linux/binfmts.h       Mon Jun  4 20:24:50 2001

>         unsigned long loader, exec;
>  };

> +/* Forward declaration */
> +struct mm_struct;
> +

I added this one to the MDK kernel compile.  I think it is an 'ac'
thing, I don't get these warnings on vanilla 2.4.[56]-pre.

--
Jeff Garzik      | Andre the Giant has a posse.
Building 1024    |
MandrakeSoft     |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Minor "cleanup" patches for 2.4.5-ac kernels

Post by Michal Jaegerman » Thu, 14 Jun 2001 11:10:07




> > --- linux-2.4.5ac/drivers/pci/quirks.c~ Tue Jun 12 16:31:12 2001
> > +++ linux-2.4.5ac/drivers/pci/quirks.c  Tue Jun 12 17:13:18 2001

> >  #include <linux/pci.h>
> >  #include <linux/init.h>
> >  #include <linux/delay.h>
> > +#include <linux/sched.h>

> >  #undef DEBUG

> > There is no problem if SMP is not configured.

> no the better place for this is include/asm-i386/delay.h.

You mean to put "#include <linux/sched.h>" into include/linux/delay.h?
Otherwise this will not help very much on Alpha when I run into
the problem; or other architectures. :-)  Works for me and indeed
it may be a better place.

Quote:> Otherwise you
> wind up solving the same problem over and over again in each similar
> driver.

'quirks.c' was the only trouble spot which tripped compilation
after changes to it.  So I kept my patch local.

Quote:> I --just-- went through on Alpha, and included linux/sched.h in
> include/asm-alpha/delay.h.  Not an hour ago :)

This was probably this hour when I was looking for that error. :-)

Quote:> Then Andrea suggested to
> simply un-inline udelay, which solved the compile problem in an even
> better way.  (we cannot un-inline udelay on x86 I think)

How about other architectures?  Each will need an individual treatment?

> > --- 2.4.5-ac11/include/linux/binfmts.h  Mon Jun  4 14:19:00 2001
> > +++ linux/include/linux/binfmts.h       Mon Jun  4 20:24:50 2001

> >         unsigned long loader, exec;
> >  };

> > +/* Forward declaration */
> > +struct mm_struct;
> > +

> I added this one to the MDK kernel compile.  I think it is an 'ac'
> thing, I don't get these warnings on vanilla 2.4.[56]-pre.

Indeed it is.  All three actually are (as I wrote).  The last one,
if not present, has a very unpleasant effect of drowning compilation
warnings in a flood as wailing happens in a header which is included
mostly everywhere.  It is very easy then to miss something where one
should pay a closer attention.

I suggested earlier some other patch for that but Alan apparently
did not like that one.  Quite possibly he was right.

  Michal

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Minor "cleanup" patches for 2.4.5-ac kernels

Post by Jeff Garzi » Fri, 15 Jun 2001 22:50:09





> > > --- linux-2.4.5ac/drivers/pci/quirks.c~ Tue Jun 12 16:31:12 2001
> > > +++ linux-2.4.5ac/drivers/pci/quirks.c  Tue Jun 12 17:13:18 2001

> > >  #include <linux/pci.h>
> > >  #include <linux/init.h>
> > >  #include <linux/delay.h>
> > > +#include <linux/sched.h>

> > >  #undef DEBUG

> > > There is no problem if SMP is not configured.

> > no the better place for this is include/asm-i386/delay.h.

> You mean to put "#include <linux/sched.h>" into include/linux/delay.h?
> Otherwise this will not help very much on Alpha when I run into
> the problem; or other architectures. :-)  Works for me and indeed
> it may be a better place.

This is an architecture-level thing.  include/asm-$arch/delay not
include/linux/delay.h

Currently, Alpha does not need to include sched.h at all...

Quote:> > Then Andrea suggested to
> > simply un-inline udelay, which solved the compile problem in an even
> > better way.  (we cannot un-inline udelay on x86 I think)

> How about other architectures?  Each will need an individual treatment?

Each arch will need individual treatment, but each alpha should decide
for itself whether or not to un-inline udelay.  It may not be possible
on some archs.

--
Jeff Garzik      | Andre the Giant has a posse.
Building 1024    |
MandrakeSoft     |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Minor "cleanup" patches for 2.4.5-ac kernels

Post by Alan Co » Sat, 16 Jun 2001 03:10:12


> --- linux-2.4.5ac/drivers/pci/quirks.c~    Tue Jun 12 16:31:12 2001
> +++ linux-2.4.5ac/drivers/pci/quirks.c     Tue Jun 12 17:13:18 2001

>  #include <linux/pci.h>
>  #include <linux/init.h>
>  #include <linux/delay.h>
> +#include <linux/sched.h>

Ok

Quote:

> This one is replacing a symbol in sg.c to one which is exported
> so 'sg.o' can be compiled as a valid module.

Export the right symbol on Alpha ?

Quote:

> +/* Forward declaration */
> +struct mm_struct;
> +

Ok
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

Minor "cleanup" patches for 2.4.5-ac kernels

Post by Michal Jaegerman » Sat, 16 Jun 2001 03:40:09



> > --- linux-2.4.5ac/drivers/pci/quirks.c~       Tue Jun 12 16:31:12 2001
> > +++ linux-2.4.5ac/drivers/pci/quirks.c        Tue Jun 12 17:13:18 2001

> >  #include <linux/pci.h>
> >  #include <linux/init.h>
> >  #include <linux/delay.h>
> > +#include <linux/sched.h>

> Ok

Jeff Garzik had some comments here and other, architecture dependent,
propositions.

Quote:

> > This one is replacing a symbol in sg.c to one which is exported
> > so 'sg.o' can be compiled as a valid module.

> Export the right symbol on Alpha ?

I do not see how this one is Alpha specific.  Patches from 'ac' series
added one reference to 'simple_strtol' in drivers/scsi/sg.c. Sure, one
more symbol can be exported, but results of this call are used only as a
zero/non-zero flag so an already exported 'simple_strtoul' will serve
instead (or we have an extra export for _one_ call in the whole kernel).

  Michal
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/