Message ID | 20200716135928.1456727-3-lee.jones@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | First batch of W=1 fixes for IIO | expand |
On Thu, 16 Jul 2020 14:59:00 +0100 Lee Jones <lee.jones@linaro.org> wrote: > Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, > struct 'bma220_acpi_id' becomes defined but unused. > > Fixes the following W=1 kernel build warning(s): > > drivers/iio/accel/bma220_spi.c:312:36: warning: ‘bma220_acpi_id’ defined but not used [-Wunused-const-variable=] > 312 | static const struct acpi_device_id bma220_acpi_id[] = { > | ^~~~~~~~~~~~~~ > > Cc: Tiberiu Breana <tiberiu.a.breana@intel.com> > Signed-off-by: Lee Jones <lee.jones@linaro.org> Applied to the togreg branch of iio.git and pushed out as testing for the autobulders to play with it. Thanks, Jonathan > --- > drivers/iio/accel/bma220_spi.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c > index cae905039cb62..439618d815594 100644 > --- a/drivers/iio/accel/bma220_spi.c > +++ b/drivers/iio/accel/bma220_spi.c > @@ -309,12 +309,14 @@ static const struct spi_device_id bma220_spi_id[] = { > {} > }; > > +#ifdef CONFIG_ACPI > static const struct acpi_device_id bma220_acpi_id[] = { > {"BMA0220", 0}, > {} > }; > > MODULE_DEVICE_TABLE(spi, bma220_spi_id); > +#endif > > static struct spi_driver bma220_driver = { > .driver = {
diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index cae905039cb62..439618d815594 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -309,12 +309,14 @@ static const struct spi_device_id bma220_spi_id[] = { {} }; +#ifdef CONFIG_ACPI static const struct acpi_device_id bma220_acpi_id[] = { {"BMA0220", 0}, {} }; MODULE_DEVICE_TABLE(spi, bma220_spi_id); +#endif static struct spi_driver bma220_driver = { .driver = {
Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, struct 'bma220_acpi_id' becomes defined but unused. Fixes the following W=1 kernel build warning(s): drivers/iio/accel/bma220_spi.c:312:36: warning: ‘bma220_acpi_id’ defined but not used [-Wunused-const-variable=] 312 | static const struct acpi_device_id bma220_acpi_id[] = { | ^~~~~~~~~~~~~~ Cc: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> --- drivers/iio/accel/bma220_spi.c | 2 ++ 1 file changed, 2 insertions(+)