Re: build #436 warning for v2.6.25-rc6-117-g457fb60 in drivers/scsi/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-03-20 at 10:05 -0400, Mark Salyzyn wrote:
> This is more a Linux Module design issue than a driver bug.
> 
> For instance, dpt_i2o.c has the following fragment:
> 
> static struct pci_device_id dptids[] = {
>          { PCI_DPT_VENDOR_ID, PCI_DPT_DEVICE_ID, PCI_ANY_ID,  
> PCI_ANY_ID,},
>          { PCI_DPT_VENDOR_ID, PCI_DPT_RAPTOR_DEVICE_ID, PCI_ANY_ID,  
> PCI_ANY_ID,},
>          { 0, }
> };
> MODULE_DEVICE_TABLE(pci,dptids);
> 
> which kind of depends on MODULE_DEVICE_TABLE doing its job. But you  
> are compiling the driver into the kernel rather than as a module and  
> the net result is the warning message.
> 
> MODULE_DEVICE_TABLE, in drivers compiled as build-in to the kernel  
> needs to 'use' it's arguments in some manner that
> a) suppresses the warning
> b) does not take up any space
> 
> Or one could add an #ifndef CONFIG_SCSI_DPT_I2O wrapped around the  
> above to suppress the warning...<ick>

Yes, very ick.  Try this ... it should force a discarded reference even
in the non-modular case.

James

---

diff --git a/include/linux/module.h b/include/linux/module.h
index 819c4e8..838c63d 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -84,7 +84,7 @@ 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)
+#define MODULE_GENERIC_TABLE(gtype,name)	((void)name)
 #define THIS_MODULE ((struct module *)0)
 #endif
 


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux