From: Lee Jones <lee.jones@linaro.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, dusonlin@emc.com.tw,
KT Liao <kt.liao@emc.com.tw>,
linux-input@vger.kernel.org
Subject: Re: [PATCH 06/20] include: input: elan-i2c-ids: Mark 'elan_acpi_id' as __maybe_unused
Date: Thu, 5 Nov 2020 09:13:05 +0000 [thread overview]
Message-ID: <20201105091305.GH4488@dell> (raw)
In-Reply-To: <20201104225054.GC1003057@dtor-ws>
On Wed, 04 Nov 2020, Dmitry Torokhov wrote:
> Hi Lee,
>
> On Wed, Nov 04, 2020 at 04:24:13PM +0000, Lee Jones wrote:
> > Some drivers which include 'elan-i2c-ids.h' make use of
> > 'elan_acpi_id', but not all do. Tell the compiler that this is
> > expected behaviour.
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> > include/linux/input/elan-i2c-ids.h:26:36: warning: ‘elan_acpi_id’ defined but not used [-Wunused-const-variable=]
> >
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Cc: dusonlin@emc.com.tw
> > Cc: KT Liao <kt.liao@emc.com.tw>
> > Cc: linux-input@vger.kernel.org
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> > include/linux/input/elan-i2c-ids.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/input/elan-i2c-ids.h b/include/linux/input/elan-i2c-ids.h
> > index 520858d126808..b6976d99b6b75 100644
> > --- a/include/linux/input/elan-i2c-ids.h
> > +++ b/include/linux/input/elan-i2c-ids.h
> > @@ -23,7 +23,7 @@
> >
> > #include <linux/mod_devicetable.h>
> >
> > -static const struct acpi_device_id elan_acpi_id[] = {
> > +static const struct acpi_device_id __maybe_unused elan_acpi_id[] = {
> > { "ELAN0000", 0 },
> > { "ELAN0100", 0 },
> > { "ELAN0600", 0 },
>
> I think I'd prefer something like this instead:
>
> diff --git a/drivers/input/mouse/elan_i2c_core.c
> b/drivers/input/mouse/elan_i2c_core.c
> index c599e21a8478..65d21a050cea 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -34,7 +34,6 @@
> #include <linux/completion.h>
> #include <linux/of.h>
> #include <linux/property.h>
> -#include <linux/input/elan-i2c-ids.h>
> #include <linux/regulator/consumer.h>
> #include <asm/unaligned.h>
>
> @@ -1413,6 +1412,7 @@ static const struct i2c_device_id elan_id[] = {
> MODULE_DEVICE_TABLE(i2c, elan_id);
>
> #ifdef CONFIG_ACPI
> +#include <linux/input/elan-i2c-ids.h>
> MODULE_DEVICE_TABLE(acpi, elan_acpi_id);
> #endif
Moving an #include file to the bottom of a source file, really?
I can do as you wish, but it's a pretty 'interesting' solution. :)
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2020-11-05 9:13 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-04 16:24 [PATCH 00/20] [Set 1/2] Rid W=1 issues from Input Lee Jones
2020-11-04 16:24 ` [PATCH 01/20] input: rmi4: rmi_bus: Fix misnaming of '__rmi_register_function_handler's 'owner' param Lee Jones
2020-11-04 16:24 ` [PATCH 02/20] input: mouse: cyapa: Fix misnaming of 'cyapa_i2c_write's 'reg' param Lee Jones
2020-11-04 17:14 ` Benson Leung
2020-11-09 6:31 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 03/20] input: mouse: cyapa_gen5: Fix obvious abuse of kernel-doc format Lee Jones
2020-11-09 6:32 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 04/20] input: misc: ab8500-ponkey: Fix incorrect name in 'ab8500_ponkey' doc header Lee Jones
2020-11-09 6:32 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 05/20] input: rmi4: rmi_f01: Struct headers are expected to start with 'struct <name>' Lee Jones
2020-11-10 0:49 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 06/20] include: input: elan-i2c-ids: Mark 'elan_acpi_id' as __maybe_unused Lee Jones
2020-11-04 22:50 ` Dmitry Torokhov
2020-11-05 9:13 ` Lee Jones [this message]
2020-11-06 7:28 ` Dmitry Torokhov
2020-11-06 7:37 ` Lee Jones
2020-11-12 10:44 ` [PATCH] input: mouse: elan_i2c_core: Move header inclusion inside Lee Jones
2020-11-18 0:33 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 07/20] input: keyboard: cros_ec_keyb: Struct headers should start with 'struct <name>' Lee Jones
2020-11-04 17:15 ` Benson Leung
2020-11-04 16:24 ` [PATCH 08/20] input: rmi4: rmi_f11: Struct headers are expected to " Lee Jones
2020-11-04 16:24 ` [PATCH 09/20] input: touchscreen: resistive-adc-touch: Struct headers should " Lee Jones
2020-11-09 6:33 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 10/20] input: mouse: synaptics: Place braces around empty if() body Lee Jones
2020-11-06 7:26 ` Dmitry Torokhov
2020-11-06 7:40 ` Lee Jones
2020-11-06 7:45 ` Joe Perches
2020-11-06 8:18 ` Lee Jones
2020-11-04 16:24 ` [PATCH 11/20] input: keyboard: gpio_keys: Fix misnamed function parameter 'dev' Lee Jones
2020-11-09 6:25 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 12/20] input: mouse: elantech: Demote obvious abuse of kernel-doc header Lee Jones
2020-11-09 6:25 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 13/20] input: rmi4: rmi_f54: Provide some missing 'REPORT_TYPE' enums Lee Jones
2020-11-04 16:24 ` [PATCH 14/20] input: rmi4: rmi_i2c: Provide some missing descriptions for struct members Lee Jones
2020-11-04 16:24 ` [PATCH 15/20] input: touchscreen: cyttsp4_core: Move 'cyttsp4_tch_abs_string' to the only file that references it Lee Jones
2020-11-09 6:36 ` Dmitry Torokhov
2020-11-09 9:17 ` Lee Jones
2020-11-04 16:24 ` [PATCH 16/20] input: misc: drv260x: Fix kernel-doc formatting and remove one abuse Lee Jones
2020-11-09 6:13 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 17/20] input: misc: drv2665: Fix formatting expected by kernel-doc Lee Jones
2020-11-09 6:16 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 18/20] input: misc: drv2667: Fix formatting and add missing member docs Lee Jones
2020-11-09 6:17 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 19/20] input: keyboard: nomadik-ske-keypad: Provide some missing struct " Lee Jones
2020-11-09 6:18 ` Dmitry Torokhov
2020-11-04 16:24 ` [PATCH 20/20] input: keyboard: pmic8xxx-keypad: Fix kernel-doc formatting Lee Jones
2020-11-09 22:02 ` Dmitry Torokhov
2020-11-06 13:24 ` [PATCH 00/20] [Set 1/2] Rid W=1 issues from Input Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201105091305.GH4488@dell \
--to=lee.jones@linaro.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dusonlin@emc.com.tw \
--cc=kt.liao@emc.com.tw \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).