Skip to contentSkip to conversation

iio: light: isl29018: Only declare ACPI table when ACPI is enabled

PATCH In review Matthias Kaehlcke 3 participants 3 messages May 19, 2017 – May 20, 2017 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: light: isl29018: Only declare ACPI table when ACPI is enabled

This fixes the following warning when building with clang:

drivers/iio/light/isl29018.c:808:36: error: variable
'isl29018_acpi_match' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]

---
 drivers/iio/light/isl29018.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/light/isl29018.c +2 -0
index 917dd8b43e72..61f5924b472d 100644
@@ -807,6 +807,7 @@ static SIMPLE_DEV_PM_OPS(isl29018_pm_ops, isl29018_suspend, isl29018_resume);
 #define ISL29018_PM_OPS NULL
 #endif
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id isl29018_acpi_match[] = {
 	{"ISL29018", isl29018},
 	{"ISL29023", isl29023},
@@ -814,6 +815,7 @@ static const struct acpi_device_id isl29018_acpi_match[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, isl29018_acpi_match);
+#endif
 
 static const struct i2c_device_id isl29018_id[] = {
 	{"isl29018", isl29018},
Signature · 1 line
2.13.0.303.g4ebf302169-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Matthias Kaehlcke

This fixes the following warning when building with clang:

drivers/iio/light/isl29018.c:808:36: error: variable
'isl29018_acpi_match' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]

Quoted 27 lines
---
 drivers/iio/light/isl29018.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/light/isl29018.c +2 -1
index 917dd8b43e72..61f5924b472d 100644
@@ -807,6 +807,7 @@ static SIMPLE_DEV_PM_OPS(isl29018_pm_ops, isl29018_suspend, isl29018_resume);
 #define ISL29018_PM_OPS NULL
 #endif
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id isl29018_acpi_match[] = {
        {"ISL29018", isl29018},
        {"ISL29023", isl29023},
@@ -814,6 +815,7 @@ static const struct acpi_device_id isl29018_acpi_match[] = {
        {},
 };
 MODULE_DEVICE_TABLE(acpi, isl29018_acpi_match);
+#endif
 
 static const struct i2c_device_id isl29018_id[] = {
        {"isl29018", isl29018},
--

2.13.0.303.g4ebf302169-goog

maintainer
#2 lore raw
Quoted 10 lines · Guenter Roeck
Quoted 7 lines · Matthias Kaehlcke

This fixes the following warning when building with clang:

drivers/iio/light/isl29018.c:808:36: error: variable
'isl29018_acpi_match' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]

I wondered if we would be slightly neater if we went with __maybe_unused markings but realised I didn't really care enough to make you respin the patch ;) So if anyone else has strong feelings on the two options, shout out now.

Applied to the togreg branch of iio.git and pushed out as testing.

Thanks,

Jonathan

Quoted 33 lines
Quoted 26 lines
---
  drivers/iio/light/isl29018.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/iio/light/isl29018.c +2 -1
index 917dd8b43e72..61f5924b472d 100644
@@ -807,6 +807,7 @@ static SIMPLE_DEV_PM_OPS(isl29018_pm_ops, isl29018_suspend, isl29018_resume);
  #define ISL29018_PM_OPS NULL
  #endif
 
+#ifdef CONFIG_ACPI
  static const struct acpi_device_id isl29018_acpi_match[] = {
         {"ISL29018", isl29018},
         {"ISL29023", isl29023},
@@ -814,6 +815,7 @@ static const struct acpi_device_id isl29018_acpi_match[] = {
         {},
  };
  MODULE_DEVICE_TABLE(acpi, isl29018_acpi_match);
+#endif
 
  static const struct i2c_device_id isl29018_id[] = {
         {"isl29018", isl29018},
--
Quoted 2 lines

2.13.0.303.g4ebf302169-goog

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html