From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Mark Salyzyn <Mark_Salyzyn@adaptec.com>
Cc: "Toralf Förster" <toralf.foerster@gmx.de>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: build #436 warning for v2.6.25-rc6-117-g457fb60 in drivers/scsi/
Date: Thu, 20 Mar 2008 10:13:10 -0500 [thread overview]
Message-ID: <1206025990.3038.22.camel@localhost.localdomain> (raw)
In-Reply-To: <4D5B18F8-8481-46FA-81A8-ABC6388F088D@adaptec.com>
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
prev parent reply other threads:[~2008-03-20 15:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-20 9:24 build #436 warning for v2.6.25-rc6-117-g457fb60 in drivers/scsi/ Toralf Förster
2008-03-20 14:05 ` Mark Salyzyn
2008-03-20 15:13 ` James Bottomley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1206025990.3038.22.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=Mark_Salyzyn@adaptec.com \
--cc=linux-scsi@vger.kernel.org \
--cc=toralf.foerster@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox