[PATCH][2.4.21-pre7] fix genksyms core dump in drivers/char/joystick

From: mikpe@csd.uu.se
Date: Sat Apr 05 2003 - 08:59:11 EST


For a long time now, building a 2.4 kernel with MODVERSIONS=y
has left a core dump from genksyms in drivers/char/joystick/.
Last Tuesday, Adam Lackorzynski reported that this was due to a
#define in pci_gameport.h: When a config option is disabled, two
functions are #defined as stubs. This causes the pre-processed
C source code containing the non-stub versions of these functions
to have serious syntax errors, which in turn causes genksyms to
dump core.

This patch fixes this problem by using inline functions for the
stubs instead of #defines.

/Mikael

--- linux-2.4.21-pre7/include/linux/pci_gameport.h.~1~ 2002-11-30 17:12:31.000000000 +0100
+++ linux-2.4.21-pre7/include/linux/pci_gameport.h 2003-04-05 14:31:20.000000000 +0200
@@ -32,8 +32,11 @@
 extern struct pcigame *pcigame_attach(struct pci_dev *dev, int type);
 extern void pcigame_detach(struct pcigame *game);
 #else
-#define pcigame_attach(a,b) NULL
-#define pcigame_detach(a)
+static inline struct pcigame *pcigame_attach(struct pci_dev *dev, int type)
+{
+ return NULL;
+}
+static inline void pcigame_detach(struct pcigame *game) { }
 #endif
 
 #endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 22:00:25 EST