linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.4.21-pre7] fix genksyms core dump in drivers/char/joystick
@ 2003-04-05 13:59 mikpe
  2003-04-05 16:31 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: mikpe @ 2003-04-05 13:59 UTC (permalink / raw)
  To: marcelo; +Cc: adam, linux-kernel

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

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

* Re: [PATCH][2.4.21-pre7] fix genksyms core dump in drivers/char/joystick
  2003-04-05 13:59 [PATCH][2.4.21-pre7] fix genksyms core dump in drivers/char/joystick mikpe
@ 2003-04-05 16:31 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2003-04-05 16:31 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: Marcelo Tosatti, adam, Linux Kernel Mailing List

On Sad, 2003-04-05 at 14:59, mikpe@csd.uu.se wrote:
> This patch fixes this problem by using inline functions for the
> stubs instead of #defines.

You've changed the semantics completely

> -#define pcigame_attach(a,b)	NULL
> -#define pcigame_detach(a)
> +static inline struct pcigame *pcigame_attach(struct pci_dev *dev, int type)
> +{
> +	return NULL;
> +}



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

end of thread, other threads:[~2003-04-05 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-05 13:59 [PATCH][2.4.21-pre7] fix genksyms core dump in drivers/char/joystick mikpe
2003-04-05 16:31 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).