Re: Working towards 2.2.0: Cosmetics..

Mike (mike@oakley.keble.ox.ac.uk)
Wed, 6 Jan 1999 19:34:05 +0000 (GMT)


On Wed, 6 Jan 1999, Mitchell Blank Jr wrote:

> Mike wrote:
> > > adb.c:15: asm/prom.h: No such file or directory
> > > adb.c:16: asm/adb.h: No such file or directory
> > > adb.c:17: asm/cuda.h: No such file or directory
> > > adb.c:18: asm/pmu.h: No such file or directory
> > > adb.c:20: asm/hydra.h: No such file or directory
> >
> > These includes exist if you are on a power-pc which is the only time you
> > might want to be compiling adb.c anyway as far as I can see.
> > They do appear when you do a make dep though, and I don't know how you'd
> > go about getting rid of them.
>
> If they were _really_ ppc-specific you could just explicitly include
> "asm-ppc/prom.h" (etc) and fix the warnings. Unforunately, asm/adb.h
> also exists for m68k, although I don't think the adb.c in the tree is
> prepared for the m68k-based macs right now.

asm/hydea.h exists only on ppc, so adb.c will compile only on ppc. The
fact that asm/adb.h also exists on m68k doesn't really matter until
somebody decides to get adb.c to work on m68k, which isn't going to happen
before 2.2.0 comes out.

> Maybe we just need to put
> those includes inside '#ifdef CONFIG_PPC' or something. It would be
> redundant from the compilers point of view (since it will never look
> at the file) but it should make 'make depend' happier.
>
Yup.
diff -u adb.c~ adb.c
--- adb.c~ Sun Nov 15 18:51:46 1998
+++ adb.c Wed Jan 6 19:29:03 1999
@@ -12,12 +12,14 @@
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/sched.h>
+#ifdef CONFIG_PPC
#include <asm/prom.h>
#include <asm/adb.h>
#include <asm/cuda.h>
#include <asm/pmu.h>
-#include <asm/uaccess.h>
#include <asm/hydra.h>
+#endif
+#include <asm/uaccess.h>
#include <asm/init.h>

EXPORT_SYMBOL(adb_hardware);

> > > 8390.c: In function `ei_close':
> > > 8390.c:177: warning: unused variable `ei_local'
> > > 8390.c: In function `set_multicast_list':
> > > 8390.c:978: warning: unused variable `ei_local'
> >
> > These are because spin_lock_irqsave and spin_lock_irqrestore often
> > ignore their first arguemnt. I say often, because it depends on
> > architecture, whether the kernel is SMP or not, and how much debuging code
> > is enabled. I can't see any easy way to remover these warnings (and they
> > are completely harmless...).
>
> Probably the best way to quiet those up would be to just cast the
> unused variable in the macro to void. For example:
> /* 'a' is not actually used in the following macro */
> #define foo(a,b) \
> do { \
> (void) (a); \
> b++; \
> } while(0)
>
> This will shut gcc up.
>
IMHO, this is ugly.

-- 
Mike <rickettm@ox.compsoc.net>

QOTD: I opened Pandora's box, let the cat out of the bag and put the ball in their court. -- Hon. J. Hacker (The Ministry of Administrative Affairs)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/