linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: light: isl29018: Only declare ACPI table when ACPI is enabled
@ 2017-05-19 21:28 Matthias Kaehlcke
  2017-05-19 21:57 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Matthias Kaehlcke @ 2017-05-19 21:28 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Brian Masney
  Cc: linux-iio, linux-kernel, Guenter Roeck, 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]

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

diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c
index 917dd8b43e72..61f5924b472d 100644
--- a/drivers/iio/light/isl29018.c
+++ b/drivers/iio/light/isl29018.c
@@ -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

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

* Re: [PATCH] iio: light: isl29018: Only declare ACPI table when ACPI is enabled
  2017-05-19 21:28 [PATCH] iio: light: isl29018: Only declare ACPI table when ACPI is enabled Matthias Kaehlcke
@ 2017-05-19 21:57 ` Guenter Roeck
  2017-05-20 16:08   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2017-05-19 21:57 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Brian Masney, linux-iio, linux-kernel,
	Guenter Roeck

On Fri, May 19, 2017 at 2:28 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
> 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]
>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
>  drivers/iio/light/isl29018.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c
> index 917dd8b43e72..61f5924b472d 100644
> --- a/drivers/iio/light/isl29018.c
> +++ b/drivers/iio/light/isl29018.c
> @@ -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
>

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

* Re: [PATCH] iio: light: isl29018: Only declare ACPI table when ACPI is enabled
  2017-05-19 21:57 ` Guenter Roeck
@ 2017-05-20 16:08   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2017-05-20 16:08 UTC (permalink / raw)
  To: Guenter Roeck, Matthias Kaehlcke
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Brian Masney, linux-iio, linux-kernel, Guenter Roeck

On 19/05/17 22:57, Guenter Roeck wrote:
> On Fri, May 19, 2017 at 2:28 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
>> 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]
>>
>> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> 
> Reviewed-by: Guenter Roeck <groeck@chromium.org>
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
> 
>> ---
>>   drivers/iio/light/isl29018.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c
>> index 917dd8b43e72..61f5924b472d 100644
>> --- a/drivers/iio/light/isl29018.c
>> +++ b/drivers/iio/light/isl29018.c
>> @@ -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
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2017-05-20 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 21:28 [PATCH] iio: light: isl29018: Only declare ACPI table when ACPI is enabled Matthias Kaehlcke
2017-05-19 21:57 ` Guenter Roeck
2017-05-20 16:08   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).