All of lore.kernel.org
 help / color / mirror / Atom feed
* Some compiler warnings in 2.4.17-pre5
@ 2001-12-07 23:16 Adrian Bunk
  2001-12-08  9:47 ` David Woodhouse
  2001-12-08 11:37 ` Alan Cox
  0 siblings, 2 replies; 4+ messages in thread
From: Adrian Bunk @ 2001-12-07 23:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: paulus, dwmw2, emoenke, jhartmann, Vineet M Abraham, Dag Brattli,
	mid, jochen, becker, elmer, ajk

[-- Attachment #1: Type: TEXT/PLAIN, Size: 10134 bytes --]

Hi,

below follow some compiler warnings I got while trying to compile a
kernel with as much as possible statically linked into the kernel with
the snapshot of gcc-2.95.4 that is in Debian unstable. If possible these
should be corrected because either
- there's a bug or
- it confuses to see a warning although there's not a bug

Because the list is very long I've listed only some of the warnings and
one compile error with some comments and suggested patches I made. Others
will come later.

I didn't include the two compile errors in the ISDN code for which there
were already patches sent to this list.

I do send an explicite Cc to all the persons that seem to be responsible
for a piece of code listed below. If you wonder why you got a Cc or if you
disagree with Cc'ing you please send me a private mail.

Any comments are welcome.


...
drivers/net/net.o: In function `deflate':
drivers/net/net.o(.text+0xc3dcc): multiple definition of `deflate'
fs/fs.o(.text+0x10134c): first defined here
drivers/net/net.o: In function `_tr_flush_block':
drivers/net/net.o(.text+0xc633c): multiple definition of `_tr_flush_block'
fs/fs.o(.text+0x1038bc): first defined here
drivers/net/net.o: In function `zlibVersion':
drivers/net/net.o(.text+0xc9c20): multiple definition of `zlibVersion'
fs/fs.o(.text+0x1071a0): first defined here
drivers/net/net.o: In function `inflate_trees_free':
...

[both jffs2 and ppp have own copies of zlib]


...
make[3]: Entering directory `/mnt/kernel/linux/drivers/cdrom'
...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o mcdx.o mcdx.c
In file included from mcdx.c:81:
mcdx.h:180: warning: #warning You have not edited mcdx.h
mcdx.h:181: warning: #warning Perhaps irq and i/o settings are wrong.


At about two years ago when I used this driver I made the attached patch
to configure these settings via "make *config". It's perhaps possible to
do it more elegant but it was working and the patch does still apply.


...
make[4]: Entering directory `/mnt/kernel/linux/drivers/char/agp'
...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -DEXPORT_SYMTAB -c agpgart_be.c
agpgart_be.c:1543: warning: `intel_820_cleanup' defined but not used

[intel_820_setup calls intel_cleanup instead of intel_820_cleanup;
 is this a bug or is intel_820_cleanup obsolete?]


...
make[4]: Entering directory `/mnt/kernel/linux/drivers/net/fc'
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o iph5526.o iph5526.c
iph5526.c:227: warning: `driver_template' defined but not used


[all uses of `driver_template' are in an "#ifdef MODULE" section]
--- drivers/net/fc/iph5526.c.~        Sun Sep 30 21:26:08 2001
+++ drivers/net/fc/iph5526.c    Fri Dec  7 00:17:13 2001
@@ -224,7 +224,9 @@
 static int get_scsi_oxid(struct fc_info *fi);
 static void update_scsi_oxid(struct fc_info *fi);

+#ifdef MODULE
 static Scsi_Host_Template driver_template = IPH5526_SCSI_FC;
+#endif /* MODULE  */

 static void iph5526_timeout(struct net_device *dev);


...
make[4]: Entering directory `/mnt/kernel/linux/drivers/net/irda'
...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o w83977af_ir.o w83977af_ir.c
w83977af_ir.c:276: warning: `w83977af_close' defined but not used

[all uses of `w83977af_close' are in an "#ifdef MODULE" section]
--- drivers/net/irda/w83977af_ir.c.old	Fri Dec  7 23:44:42 2001
+++ drivers/net/irda/w83977af_ir.c	Fri Dec  7 23:45:52 2001
@@ -90,7 +90,9 @@
 /* Some prototypes */
 static int  w83977af_open(int i, unsigned int iobase, unsigned int irq,
                           unsigned int dma);
+#ifdef MODULE
 static int  w83977af_close(struct w83977af_ir *self);
+#endif /* MODULE */
 static int  w83977af_probe(int iobase, int irq, int dma);
 static int  w83977af_dma_receive(struct w83977af_ir *self);
 static int  w83977af_dma_receive_complete(struct w83977af_ir *self);
@@ -266,6 +268,8 @@
 	return 0;
 }

+#ifdef MODULE
+
 /*
  * Function w83977af_close (self)
  *
@@ -314,6 +318,8 @@

 	return 0;
 }
+
+#endif /* MODULE */

 int w83977af_probe( int iobase, int irq, int dma)
 {



...
make[4]: Entering directory `/mnt/kernel/linux/drivers/net/tokenring'
...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o tmsisa.o tmsisa.c
tmsisa.c:44: warning: `portlist' defined but not used


[all uses of `portlist' are in an "#ifdef MODULE" section]
--- drivers/net/tokenring/tmsisa.c.old	Fri Dec  7 23:36:24 2001
+++ drivers/net/tokenring/tmsisa.c	Fri Dec  7 23:37:18 2001
@@ -40,11 +40,15 @@

 #define TMS_ISA_IO_EXTENT 32

+#ifdef MODULE
+
 /* A zero-terminated list of I/O addresses to be probed. */
 static unsigned int portlist[] __initdata = {
 	0x0A20, 0x1A20, 0x0B20, 0x1B20, 0x0980, 0x1980, 0x0900, 0x1900,// SK
 	0
 };
+
+#endif /* MODULE */

 /* A zero-terminated list of IRQs to be probed.
  * Used again after initial probe for sktr_chipset_init, called from sktr_open.



...
make[3]: Entering directory `/mnt/kernel/linux/drivers/net'
...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o winbond-840.o winbond-840.c
winbond-840.c:146: warning: `version' defined but not used


[all uses of `version' are in an "#ifdef MODULE" section]
--- drivers/net/winbond-840.c.old	Fri Dec  7 23:38:21 2001
+++ drivers/net/winbond-840.c	Fri Dec  7 23:38:56 2001
@@ -142,10 +142,14 @@
 #include <asm/io.h>
 #include <asm/irq.h>

+#ifdef MODULE
+
 /* These identify the driver base version and may not be removed. */
 static char version[] __devinitdata =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " DRV_RELDATE "  Donald Becker <becker@scyld.com>\n"
 KERN_INFO "  http://www.scyld.com/network/drivers.html\n";
+
+#endif /* MODULE */

 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
 MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver");



...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -DEXPORT_SYMTAB -c arlan.c
arlan.c:26: warning: `probe' defined but not used
arlan.c:1128: warning: `arlan_find_devices' defined but not used


[all uses of `probe' and `arlan_find_devices' are in an
 "#ifdef MODULE" section]
--- drivers/net/arlan.c.old	Fri Dec  7 23:40:00 2001
+++ drivers/net/arlan.c	Fri Dec  7 23:40:52 2001
@@ -23,7 +23,9 @@
 static char *siteName = siteNameUNKNOWN;
 static int mem = memUNKNOWN;
 int arlan_debug = debugUNKNOWN;
+#ifdef MODULE
 static int probe = probeUNKNOWN;
+#endif /* MODULE */
 static int numDevices = numDevicesUNKNOWN;
 static int spreadingCode = spreadingCodeUNKNOWN;
 static int channelNumber = channelNumberUNKNOWN;
@@ -1124,6 +1126,8 @@
 	return -ENODEV;
 }

+#ifdef MODULE
+
 static int __init arlan_find_devices(void)
 {
 	int m;
@@ -1142,6 +1146,7 @@
 	return found;
 }

+#endif /* MODULE */

 static int arlan_change_mtu(struct net_device *dev, int new_mtu)
 {



...
make[3]: Entering directory `/mnt/kernel/linux/drivers/net/hamradio'
...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o 6pack.o 6pack.c
6pack.c:703: warning: `msg_invparm' defined but not used

[`msg_invparm' is never used]
--- drivers/net/hamradio/6pack.c.old	Fri Dec  7 23:41:59 2001
+++ drivers/net/hamradio/6pack.c	Fri Dec  7 23:42:19 2001
@@ -700,7 +700,6 @@
 /* Initialize 6pack control device -- register 6pack line discipline */

 static char msg_banner[]  __initdata = KERN_INFO "AX.25: 6pack driver, " SIXPACK_VERSION " (dynamic channels, max=%d)\n";
-static char msg_invparm[] __initdata = KERN_ERR  "6pack: sixpack_maxdev parameter too large.\n";
 static char msg_nomem[]   __initdata = KERN_ERR  "6pack: can't allocate sixpack_ctrls[] array! No 6pack available.\n";
 static char msg_regfail[] __initdata = KERN_ERR  "6pack: can't register line discipline (err = %d)\n";


...
make[3]: Entering directory `/mnt/kernel/linux/drivers/scsi'
...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o qla1280.o qla1280.c
qla1280.c:1615: warning: `qla1280_do_dpc' defined but not used

[the only call of this function is in the else path of an
 "#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,95)"; it seems to be a bit
 strange that these "if"s also appears inside qla1280_do_dpc, IOW there's
 code in this function that will neither be called in a kernel < 2.1.95
 nor in a kernel >= 2.1.95]


...
gcc -D__KERNEL__ -I/mnt/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trig
raphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferre
d-stack-boundary=2 -march=k6    -c -o i60uscsi.o i60uscsi.c
i60uscsi.c: In function `__orc_alloc_scb':
i60uscsi.c:643: warning: unused variable `flags'


[`flags' is never used in this function]
--- drivers/scsi/i60uscsi.c.old	Fri Dec  7 23:43:13 2001
+++ drivers/scsi/i60uscsi.c	Fri Dec  7 23:43:34 2001
@@ -640,7 +640,6 @@
 	ULONG idx;
 	UCHAR index;
 	UCHAR i;
-	ULONG flags;

 	Ch = hcsp->HCS_Index;
 	for (i = 0; i < 8; i++) {




cu
Adrian

-- 

Get my GPG key: finger bunk@debian.org | gpg --import

Fingerprint: B29C E71E FE19 6755 5C8A  84D4 99FC EA98 4F12 B400

[-- Attachment #2: Type: TEXT/PLAIN, Size: 3879 bytes --]

diff -u -r linux.old/drivers/cdrom/Config.in linux/drivers/cdrom/Config.in
--- linux.old/drivers/cdrom/Config.in	Tue Jan 11 22:33:46 2000
+++ linux/drivers/cdrom/Config.in	Tue Jan 11 22:38:40 2000
@@ -19,6 +19,32 @@
    hex 'MCD I/O base' CONFIG_MCD_BASE 300
 fi
 tristate '  Mitsumi [XA/MultiSession] CDROM support' CONFIG_MCDX
+if [ "$CONFIG_MCDX" != "n" ]; then
+choice 'Number of CDROM drives' \
+        "1			CONFIG_NUMBER_MCDX1	\
+         2			CONFIG_NUMBER_MCDX2	\
+         3			CONFIG_NUMBER_MCDX3	\
+         4			CONFIG_NUMBER_MCDX4	\
+         5			CONFIG_NUMBER_MCDX5	" 1
+  int 'MCDX IRQ drive 1' CONFIG_MCDX_IRQ1 11
+  hex 'MCDX I/O base drive 1' CONFIG_MCDX_BASE1 300
+  if [ "$CONFIG_NUMBER_MCDX1" = "n" ]; then
+    int 'MCDX IRQ drive 2' CONFIG_MCDX_IRQ2 5
+    hex 'MCDX I/O base drive 2' CONFIG_MCDX_BASE2 304
+    if [ "$CONFIG_NUMBER_MCDX2" = "n" ]; then
+      int 'MCDX IRQ drive 3' CONFIG_MCDX_IRQ3 0
+      hex 'MCDX I/O base drive 3' CONFIG_MCDX_BASE3 000
+      if [ "$CONFIG_NUMBER_MCDX3" = "n" ]; then
+        int 'MCDX IRQ drive 4' CONFIG_MCDX_IRQ4 0
+        hex 'MCDX I/O base drive 4' CONFIG_MCDX_BASE4 000
+        if [ "$CONFIG_NUMBER_MCDX4" = "n" ]; then
+          int 'MCDX IRQ drive 5' CONFIG_MCDX_IRQ5 0
+          hex 'MCDX I/O base drive 5' CONFIG_MCDX_BASE5 000
+        fi
+      fi
+    fi
+  fi
+fi
 tristate '  Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD
 tristate '  Philips/LMS CM206 CDROM support' CONFIG_CM206
 tristate '  Sanyo CDR-H94A CDROM support' CONFIG_SJCD
diff -u -r linux.old/drivers/cdrom/mcdx.h linux/drivers/cdrom/mcdx.h
--- linux.old/drivers/cdrom/mcdx.h	Tue Jan 11 22:33:46 2000
+++ linux/drivers/cdrom/mcdx.h	Tue Jan 11 22:34:25 2000
@@ -54,13 +54,57 @@
  *	NOTE: I didn't get a drive at irq 9(2) working.  Not even alone.
  */
 #if MCDX_AUTOPROBE == 0
-	#define MCDX_NDRIVES 1
+
+/*	
+ *      The right CONFIG_NUMBER_MCDXx is set by the Configure script.
+ */
+#if CONFIG_NUMBER_MCDX1 
+  #define MCDX_NDRIVES 1
+  #else
+  #if CONFIG_NUMBER_MCDX2
+    #define MCDX_NDRIVES 2
+    #else
+    #if CONFIG_NUMBER_MCDX3
+      #define MCDX_NDRIVES 3
+      #else
+      #if CONFIG_NUMBER_MCDX4
+        #define MCDX_NDRIVES 4
+        #else
+        #define MCDX_NDRIVES 5
+      #endif
+    #endif
+  #endif
+#endif
+
+/*
+ *      Some (unimportant) values may be undefined after Configure.
+ */
+#ifndef CONFIG_MCDX_BASE2
+#define CONFIG_MCDX_BASE2 0
+#define CONFIG_MCDX_IRQ2 0
+#endif
+
+#ifndef CONFIG_MCDX_BASE3
+#define CONFIG_MCDX_BASE3 0
+#define CONFIG_MCDX_IRQ3 0
+#endif
+
+#ifndef CONFIG_MCDX_BASE4
+#define CONFIG_MCDX_BASE4 0
+#define CONFIG_MCDX_IRQ4 0
+#endif
+
+#ifndef CONFIG_MCDX_BASE5
+#define CONFIG_MCDX_BASE5 0
+#define CONFIG_MCDX_IRQ5 0
+#endif
+
 	#define MCDX_DRIVEMAP {		\
-			{0x300, 11},	\
-			{0x304, 05},  	\
-			{0x000, 00},  	\
-			{0x000, 00},  	\
-			{0x000, 00},  	\
+			{CONFIG_MCDX_BASE1, CONFIG_MCDX_IRQ1},	\
+			{CONFIG_MCDX_BASE2, CONFIG_MCDX_IRQ2},  	\
+			{CONFIG_MCDX_BASE3, CONFIG_MCDX_IRQ3},  	\
+			{CONFIG_MCDX_BASE4, CONFIG_MCDX_IRQ4},  	\
+			{CONFIG_MCDX_BASE5, CONFIG_MCDX_IRQ5},  	\
 	  	}
 #else
 	#error Autoprobing is not implemented yet.
@@ -74,10 +118,6 @@
 #define MCDX_DEBUG   0
 #endif
 
-/* *** make the following line uncommented, if you're sure,
- * *** all configuration is done */
-/* #define I_WAS_HERE */
-
 /*	The name of the device */
 #define MCDX "mcdx"	
 
@@ -174,12 +214,5 @@
 #define MCDX_E		1			/* unspec error */
 #define MCDX_ST_EOM 0x0100		/* end of media */
 #define MCDX_ST_DRV 0x00ff		/* mask to query the drive status */
-
-#ifndef I_WAS_HERE
-#ifndef MODULE
-#warning You have not edited mcdx.h
-#warning Perhaps irq and i/o settings are wrong.
-#endif
-#endif
 
 /* ex:set ts=4 sw=4: */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Some compiler warnings in 2.4.17-pre5
  2001-12-07 23:16 Some compiler warnings in 2.4.17-pre5 Adrian Bunk
@ 2001-12-08  9:47 ` David Woodhouse
  2001-12-08 11:37 ` Alan Cox
  1 sibling, 0 replies; 4+ messages in thread
From: David Woodhouse @ 2001-12-08  9:47 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, paulus


bunk@fs.tum.de said:
>  [both jffs2 and ppp have own copies of zlib]

They have identical copies of zlib, except for a typo fix in a comment in 
the PPP version which was made after I copied it. It's probably worth 
hacking the makefiles so that only one gets built and included.

In due course, the new zlib in fs/inflate_fs will get expanded to do 
compression as well as decompression, and moved out of fs/ where it doesn't 
really belong. At that point, JFFS2 and PPP can both use that.

You could prefix all the non-static symbols in either or both of these zlib 
copies with 'ppp_' or 'jffs2_', but I prefer not to do that as it's just 
hiding the problem, not fixing it.

--
dwmw2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Some compiler warnings in 2.4.17-pre5
  2001-12-07 23:16 Some compiler warnings in 2.4.17-pre5 Adrian Bunk
  2001-12-08  9:47 ` David Woodhouse
@ 2001-12-08 11:37 ` Alan Cox
  2001-12-12 19:17   ` Adrian Bunk
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Cox @ 2001-12-08 11:37 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: linux-kernel, paulus, dwmw2, emoenke, jhartmann,
	Vineet M Abraham, Dag Brattli, mid, jochen, becker, elmer, ajk

> +#ifdef MODULE
>  static Scsi_Host_Template driver_template = IPH5526_SCSI_FC;
> +#endif /* MODULE  */

The ifdefs are frequently uglier than the warning 8). The i820 one looks
most suspicious however.

Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Some compiler warnings in 2.4.17-pre5
  2001-12-08 11:37 ` Alan Cox
@ 2001-12-12 19:17   ` Adrian Bunk
  0 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2001-12-12 19:17 UTC (permalink / raw)
  To: Alan Cox
  Cc: linux-kernel, paulus, dwmw2, emoenke, jhartmann,
	Vineet M Abraham, Dag Brattli, mid, jochen, becker, elmer, ajk

On Sat, 8 Dec 2001, Alan Cox wrote:

> > +#ifdef MODULE
> >  static Scsi_Host_Template driver_template = IPH5526_SCSI_FC;
> > +#endif /* MODULE  */
>
> The ifdefs are frequently uglier than the warning 8). The i820 one looks
> most suspicious however.


It's perhaps a better solution to move driver_template inside the
#ifdef MODULE piece of code where it's used (I see that this was done in
some other places in 2.4.17-pre2 by David S. Miller):


--- drivers/net/fc/iph5526.c.old	Wed Dec 12 20:11:44 2001
+++ drivers/net/fc/iph5526.c	Wed Dec 12 20:13:34 2001
@@ -224,8 +224,6 @@
 static int get_scsi_oxid(struct fc_info *fi);
 static void update_scsi_oxid(struct fc_info *fi);

-static Scsi_Host_Template driver_template = IPH5526_SCSI_FC;
-
 static void iph5526_timeout(struct net_device *dev);

 static int iph5526_probe_pci(struct net_device *dev);
@@ -4529,6 +4527,7 @@
 static int irq;
 static int bad;	/* 0xbad = bad sig or no reset ack */
 static int scsi_registered;
+static Scsi_Host_Template driver_template = IPH5526_SCSI_FC;


 int init_module(void)

> Alan

cu
Adrian

-- 

Get my GPG key: finger bunk@debian.org | gpg --import

Fingerprint: B29C E71E FE19 6755 5C8A  84D4 99FC EA98 4F12 B400



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-12-12 19:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-07 23:16 Some compiler warnings in 2.4.17-pre5 Adrian Bunk
2001-12-08  9:47 ` David Woodhouse
2001-12-08 11:37 ` Alan Cox
2001-12-12 19:17   ` Adrian Bunk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.