netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Fix ehea warning when built in
@ 2013-11-21  4:36 Michael Neuling
  2013-11-21 18:07 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Neuling @ 2013-11-21  4:36 UTC (permalink / raw)
  To: Jeff Mahoney, Olaf Hering, Jiri Slaby
  Cc: David S. Miller, netdev, Thadeu Lima de Souza Cascardo

In:
  commit 7a3a62128388a6af771e99df8628ddee2e8be7ca
  Author: Olaf Hering <ohering@suse.com>
  drivers/net/ethernet/ibm/ehea/ehea_main.c: add alias entry for portN properties
We added ehea_module_device_table.  Unfortunately we only use this when
building as a module so we get the following warning when built in, like
in pseries_defconfig:

  drivers/net/ethernet/ibm/ehea/ehea_main.c:105:1: warning: 'ehea_module_device_table' defined but not used [-Wunused-variable]

This wraps ehea_module_device_table with #if MODULE.

Signed-off-by: Michael Neuling <mikey@neuling.org>

diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 2d1c6bd..a17a1d1 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -102,6 +102,7 @@ static int ehea_probe_adapter(struct platform_device *dev);
 
 static int ehea_remove(struct platform_device *dev);
 
+#ifdef MODULE
 static struct of_device_id ehea_module_device_table[] = {
 	{
 		.name = "lhea",
@@ -114,6 +115,7 @@ static struct of_device_id ehea_module_device_table[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, ehea_module_device_table);
+#endif
 
 static struct of_device_id ehea_device_table[] = {
 	{

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: Fix ehea warning when built in
  2013-11-21  4:36 [PATCH] net: Fix ehea warning when built in Michael Neuling
@ 2013-11-21 18:07 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-11-21 18:07 UTC (permalink / raw)
  To: mikey; +Cc: jeffm, ohering, jslaby, netdev, cascardo

From: Michael Neuling <mikey@neuling.org>
Date: Thu, 21 Nov 2013 15:36:49 +1100

> In:
>   commit 7a3a62128388a6af771e99df8628ddee2e8be7ca
>   Author: Olaf Hering <ohering@suse.com>
>   drivers/net/ethernet/ibm/ehea/ehea_main.c: add alias entry for portN properties
> We added ehea_module_device_table.  Unfortunately we only use this when
> building as a module so we get the following warning when built in, like
> in pseries_defconfig:
> 
>   drivers/net/ethernet/ibm/ehea/ehea_main.c:105:1: warning: 'ehea_module_device_table' defined but not used [-Wunused-variable]
> 
> This wraps ehea_module_device_table with #if MODULE.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>

I think putting an ugly MODULE ifdef into every driver that does something
like this is not going to cut it.

Rather, the MODULE_DEVICE_TABLE() definition when !MODULE should do something
reasonable, like make a void reference to the symbole.

I'm not applying this, the fix belongs in a generic place.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-21 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21  4:36 [PATCH] net: Fix ehea warning when built in Michael Neuling
2013-11-21 18:07 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).