Re: [PATCH 1/3] [SCSI] dpt_i2o: fix compiler warning on dptids

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: James Bottomley
Date: Tuesday, December 7, 2010 - 9:30 am

On Wed, 2010-12-08 at 01:12 +0900, Namhyung Kim wrote:

I didn't mean changing any c files.  I meant fixing the module include
to make the table used even in the !MODULE case.  That way we only alter
one file instead of a significant proportion of the drivers.

James

---

diff --git a/include/linux/module.h b/include/linux/module.h
index 7575bbb..d49aa9c 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -90,7 +90,10 @@ extern const struct gtype##_id __mod_##gtype##_table		\
 extern struct module __this_module;
 #define THIS_MODULE (&__this_module)
 #else  /* !MODULE */
-#define MODULE_GENERIC_TABLE(gtype,name)
+/* Flag name as used to avoid warnings about the unused device id table */
+#define MODULE_GENERIC_TABLE(gtype,name)			\
+static const struct gtype##_id __mod_##gtype##_table		\
+  __attribute__ ((unused, alias(__stringify(name))))
 #define THIS_MODULE ((struct module *)0)
 #endif
 



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/3] [SCSI] dpt_i2o: fix compiler warning on dptids, James Bottomley, (Tue Dec 7, 9:30 am)