Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1675209 > unrolled thread

[PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable

Started byMatthias Kaehlcke <mka@chromium.org>
First post2017-06-27 02:30 +0200
Last post2017-07-01 14:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable Matthias Kaehlcke <mka@chromium.org> - 2017-06-27 02:30 +0200
    Re: [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable Linus Walleij <linus.walleij@linaro.org> - 2017-06-29 15:00 +0200
      Re: [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is  enable Jonathan Cameron <jic23@kernel.org> - 2017-07-01 14:20 +0200

#1675209 — [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable

FromMatthias Kaehlcke <mka@chromium.org>
Date2017-06-27 02:30 +0200
Subject[PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable
Message-ID<tWMyd-15q-5@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1677724

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-06-29 15:00 +0200
Message-ID<tXHd7-7Io-9@gated-at.bofh.it>
In reply to#1675209
On Tue, Jun 27, 2017 at 2:25 AM, Matthias Kaehlcke <mka@chromium.org> wrote:

> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

[toc] | [prev] | [next] | [standalone]


#1679344 — Re: [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable

FromJonathan Cameron <jic23@kernel.org>
Date2017-07-01 14:20 +0200
SubjectRe: [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable
Message-ID<tYpxv-368-15@gated-at.bofh.it>
In reply to#1677724
On Thu, 29 Jun 2017 14:51:56 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Tue, Jun 27, 2017 at 2:25 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> 
> > 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>  
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Yours,
> Linus Walleij
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

I'm curious though... Can the compiler not optimize this away? 
I'd always assumed the main reason for these warnings was that the
presence of unused data might represent a bug rather than it actually
making any difference to the size...

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web