Skip to contentSkip to conversation

Fix AGP __setup warning + elsewhere

PATCH New John Levon 1 participant 1 message Sep 8, 2003

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 Fix AGP __setup warning + elsewhere

drivers/char/agp/backend.c:322: warning: `agp_setup' defined but not used

Whilst __setup is allegedly obsolete, this usage at least is going to stay around, and there are plenty of other places that currently have unnecessary #ifdefs (any place that's worried about a few bytes of module size bloat can still keep the ifdefs of course ...)

This just uses the same trick as module_init() to avoid the warning.

regards
john

include/linux/init.h +3 -1
diff -Naurp -X dontdiff linux-cvs/include/linux/init.h linux-fixes/include/linux/init.h
@@ -167,7 +167,9 @@ struct obs_kernel_param {
 	{ return exitfn; }					\
 	void cleanup_module(void) __attribute__((alias(#exitfn)));
 
-#define __setup(str,func) /* nothing */
+#define __setup(str,func)                                       \
+	static inline int (*__setup_dummy_##func(void))(char *) \
+	{ return func; }
 #endif
 
 /* Data marked not to be saved by software_suspend() */