public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: James Bottomley <James.Bottomley@suse.de>
Cc: linux-scsi@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] [SCSI] dpt_i2o: fix compiler warning on dptids
Date: Wed, 08 Dec 2010 02:24:53 +0900	[thread overview]
Message-ID: <1291742693.1638.22.camel@leonhard> (raw)
In-Reply-To: <1291739449.17668.9.camel@mulgrave.site>

2010-12-07 (화), 10:30 -0600, James Bottomley:
> On Wed, 2010-12-08 at 01:12 +0900, Namhyung Kim wrote:
> > MODULE_DEVICE_TABLE expands to nop when !MODULE (not !CONFIG_MODULE) so
> > allyesconfig build always emits the warnings. Possible patch for this
> > would be wraping it up in #ifdefs but when I sent a same patch to Greg
> > KH he didn't want to add more #ifdefs in .c files.
> 
> 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.
> 

It would not be a _significant_ proportion because normal drivers may
refer the table in their driver struct. :)

Anyway the patch below looks good to me. I'll happily drop my patches if
you apply this in your tree.

Thanks.

> 
> 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
>  


-- 
Regards,
Namhyung Kim


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

  reply	other threads:[~2010-12-07 17:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 15:31 [PATCH 1/3] [SCSI] dpt_i2o: fix compiler warning on dptids Namhyung Kim
2010-12-07 15:31 ` [PATCH 2/3] [SCSI] fdomain: fix compiler warning on fdomain_pci_tbl Namhyung Kim
2010-12-07 15:31 ` [PATCH 3/3] [SCSI] initio: fix compiler warning on i91u_pci_devices Namhyung Kim
2010-12-07 15:57 ` [PATCH 1/3] [SCSI] dpt_i2o: fix compiler warning on dptids James Bottomley
2010-12-07 16:12   ` Namhyung Kim
2010-12-07 16:30     ` James Bottomley
2010-12-07 17:24       ` Namhyung Kim [this message]
2010-12-08 16:20         ` Namhyung Kim
2010-12-08 16:24           ` James Bottomley

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=1291742693.1638.22.camel@leonhard \
    --to=namhyung@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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