Skip to contentSkip to conversation

net: Fix ehea warning when built in

PATCH In review Michael Neuling 2 participants 2 messages Nov 21, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Fix ehea warning when built in

In:
commit 7a3a62128388a6af771e99df8628ddee2e8be7ca
Author: Olaf Hering <[email protected]> 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.

drivers/net/ethernet/ibm/ehea/ehea_main.c +2 -0
index 2d1c6bd..a17a1d1 100644
@@ -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[] = {
 	{
maintainer
#1 lore raw

From: Michael Neuling <[email protected]>
Date: Thu, 21 Nov 2013 15:36:49 +1100

Quoted 8 lines

In:
commit 7a3a62128388a6af771e99df8628ddee2e8be7ca
Author: Olaf Hering <[email protected]> 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:

Quoted 5 lines

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.

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.