Re: [PATCH 4/6] Werror: Hide warnings on static module devicetables

From: Adrian Bunk
Date: Thu May 29 2008 - 15:27:45 EST


On Thu, May 29, 2008 at 07:17:41PM +0100, David Howells wrote:
> Hide warnings on static module device tables that are produced when compiling a
> driver in to the core kernel rather than compiling it as a module.
>
> This is done by introducing a MODULE_STATIC_DEVICE_TABLE() version of
> MODULE_DEVICE_TABLE() for device ID tables that are declared static. This
> tells the compiler that the table is unused, thus suppressing warnings of the
> type:
>
> mod.c:37: warning: 'id_table' defined but not used
>
> MODULE_STATIC_DEVICE_TABLE() should not be used for non-static tables.
>
> A MODULE_STATIC_GENERIC_TABLE() is also added for the same reason as a version
> of MODULE_GENERIC_TABLE().
>
> This does not automatically cause the table to be emitted by the compiler; that
> will only happen if something references it.
>
> Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
> ---
>
> drivers/char/ip2/ip2main.c | 2 +-
> drivers/char/rocket.c | 2 +-
> drivers/char/specialix.c | 2 +-
> drivers/isdn/hisax/config.c | 2 +-
> drivers/media/video/zoran_card.c | 2 +-
> drivers/scsi/dpt_i2o.c | 2 +-
> drivers/scsi/fdomain.c | 2 +-
> drivers/scsi/initio.c | 2 +-
> drivers/telephony/ixj.c | 2 +-
> drivers/watchdog/alim1535_wdt.c | 2 +-
> drivers/watchdog/alim7101_wdt.c | 2 +-
> include/linux/module.h | 28 +++++++++++++++++++++++-----
> sound/oss/ad1848.c | 2 +-
>...

Isn't the warning often a reminder that a driver should be updated to
use pci_register_driver() etc. ?

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

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