Skip to contentSkip to conversation

Build warning in i5k_amb.c

lm-sensors Guenter Roeck 2 participants 2 messages Nov 19, 2010

lore
Share & tools
lore
#0 lore raw

Hi all,

the following build warning is reported in the "Build regressions/improvements in v2.6.37-rc2" post sent to lkml.

drivers/hwmon/i5k_amb.c:500: warning: 'i5k_amb_ids' defined but not used: 1 warnings in 1 logs

        v2.6.37-rc2/powerpc/powerpc-allyesconfig

Any idea how to fix it ? I am a bit at loss about what is going on.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw

Hi Guenter,

Quoted 7 lines · Guenter Roeck

the following build warning is reported in the "Build regressions/improvements in v2.6.37-rc2" post sent to lkml.

drivers/hwmon/i5k_amb.c:500: warning: 'i5k_amb_ids' defined but not used: 1 warnings in 1 logs

        v2.6.37-rc2/powerpc/powerpc-allyesconfig

Any idea how to fix it ? I am a bit at loss about what is going on.

MODULE_DEVICE_TABLE() resolves to nothing if the driver is built into the kernel (as opposed to built as a module). Other drivers don't get a warning because the IDs are also used by the driver itself, but for a reason unknown to me [1], this driver registers itself as a platform driver rather than a PCI driver, and thus can't point to PCI IDs.

You can reproduce the warning by building your kernel with:
CONFIG_SENSORS_I5K_AMB=y

The fix should be as easy as embracing the declaration of i5k_amb_ids with a #ifdef MODULE/#endif pair.

[1] Might as well be that I knew it but forgot by now.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors