public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable
@ 2017-06-27  0:25 Matthias Kaehlcke
  2017-06-29 12:51 ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Kaehlcke @ 2017-06-27  0:25 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Linus Walleij
  Cc: linux-iio, linux-kernel, dianders, Matthias Kaehlcke

Don't inflate the kernel size with data that isn't used. The conditional
declaration also fixes the following warning when building with clang:

drivers/iio/magnetometer/ak8975.c:704:36: error: variable 'ak_acpi_match'
  is not needed and will not be emitted
  [-Werror,-Wunneeded-internal-declaration]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 drivers/iio/magnetometer/ak8975.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 825369fb1c57..4ff883942f7b 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -784,6 +784,7 @@ static const struct iio_info ak8975_info = {
 	.driver_module = THIS_MODULE,
 };
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id ak_acpi_match[] = {
 	{"AK8975", AK8975},
 	{"AK8963", AK8963},
@@ -793,6 +794,7 @@ static const struct acpi_device_id ak_acpi_match[] = {
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, ak_acpi_match);
+#endif
 
 static const char *ak8975_match_acpi_device(struct device *dev,
 					    enum asahi_compass_chipset *chipset)
-- 
2.13.1.611.g7e3b11ae1-goog

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

end of thread, other threads:[~2017-07-06 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-27  0:25 [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable Matthias Kaehlcke
2017-06-29 12:51 ` Linus Walleij
2017-07-01 12:11   ` Jonathan Cameron
2017-07-06 16:42     ` Matthias Kaehlcke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox