From: Lee Jones <lee.jones@linaro.org> To: Chen-Yu Tsai <wens@csie.org> Cc: linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, linux-kernel <linux-kernel@vger.kernel.org>, Carlo Caione <carlo@caione.org> Subject: Re: [PATCH 5/5] mfd: axp20x-i2c: Do not define 'struct acpi_device_id' when !CONFIG_ACPI Date: Mon, 6 Jul 2020 08:31:11 +0100 [thread overview] Message-ID: <20200706073111.GD2821869@dell> (raw) In-Reply-To: <CAGb2v66Ws4WNPZbOYQvikKoozj_2WjzS-Jq-o2VxT77=k0vODw@mail.gmail.com> On Mon, 29 Jun 2020, Chen-Yu Tsai wrote: > Adding Hans to the list as he's the one that deals with all the x86 > platforms that use this series of chips. > > On Mon, Jun 29, 2020 at 8:32 PM Lee Jones <lee.jones@linaro.org> wrote: > > > > Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, > > struct axp20x_i2c_acpi_match becomes defined by unused. > > > > This squashes the current W=1 kernel builds warning: > > > > drivers/mfd/axp20x-i2c.c:82:36: warning: ‘axp20x_i2c_acpi_match’ defined but not used [-Wunused-const-variable=] > > > > Cc: Chen-Yu Tsai <wens@csie.org> > > Cc: Carlo Caione <carlo@caione.org> > > Signed-off-by: Lee Jones <lee.jones@linaro.org> > > --- > > drivers/mfd/axp20x-i2c.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c > > index 14f9df74f855c..3dd650125c239 100644 > > --- a/drivers/mfd/axp20x-i2c.c > > +++ b/drivers/mfd/axp20x-i2c.c > > @@ -79,6 +79,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = { > > }; > > MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id); > > > > +#if IS_ENABLED(CONFIG_ACPI) > > static const struct acpi_device_id axp20x_i2c_acpi_match[] = { > > I'd rather use "__maybe_unused" if possible to at least get a compile > check, and also because "ACPI_PTR NULLifies the value" might not be > well known to people not working on ACPI-based platforms. FYI, I've gone back to this patch, as it seems to be the common census across the rest of the kernel, due to the extra space saving. The code will get compile checks when compiled with different architectures, and I'm not sure I understand the last point you made. > Either way, > > Acked-by: Chen-Yu Tsai <wens@csie.org> I've applied this to the patch. Thanks. > > { > > .id = "INT33F4", > > @@ -87,6 +88,7 @@ static const struct acpi_device_id axp20x_i2c_acpi_match[] = { > > { }, > > }; > > MODULE_DEVICE_TABLE(acpi, axp20x_i2c_acpi_match); > > +#endif > > > > static struct i2c_driver axp20x_i2c_driver = { > > .driver = { > > -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org> To: Chen-Yu Tsai <wens@csie.org> Cc: Carlo Caione <carlo@caione.org>, linux-kernel <linux-kernel@vger.kernel.org>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH 5/5] mfd: axp20x-i2c: Do not define 'struct acpi_device_id' when !CONFIG_ACPI Date: Mon, 6 Jul 2020 08:31:11 +0100 [thread overview] Message-ID: <20200706073111.GD2821869@dell> (raw) In-Reply-To: <CAGb2v66Ws4WNPZbOYQvikKoozj_2WjzS-Jq-o2VxT77=k0vODw@mail.gmail.com> On Mon, 29 Jun 2020, Chen-Yu Tsai wrote: > Adding Hans to the list as he's the one that deals with all the x86 > platforms that use this series of chips. > > On Mon, Jun 29, 2020 at 8:32 PM Lee Jones <lee.jones@linaro.org> wrote: > > > > Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, > > struct axp20x_i2c_acpi_match becomes defined by unused. > > > > This squashes the current W=1 kernel builds warning: > > > > drivers/mfd/axp20x-i2c.c:82:36: warning: ‘axp20x_i2c_acpi_match’ defined but not used [-Wunused-const-variable=] > > > > Cc: Chen-Yu Tsai <wens@csie.org> > > Cc: Carlo Caione <carlo@caione.org> > > Signed-off-by: Lee Jones <lee.jones@linaro.org> > > --- > > drivers/mfd/axp20x-i2c.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c > > index 14f9df74f855c..3dd650125c239 100644 > > --- a/drivers/mfd/axp20x-i2c.c > > +++ b/drivers/mfd/axp20x-i2c.c > > @@ -79,6 +79,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = { > > }; > > MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id); > > > > +#if IS_ENABLED(CONFIG_ACPI) > > static const struct acpi_device_id axp20x_i2c_acpi_match[] = { > > I'd rather use "__maybe_unused" if possible to at least get a compile > check, and also because "ACPI_PTR NULLifies the value" might not be > well known to people not working on ACPI-based platforms. FYI, I've gone back to this patch, as it seems to be the common census across the rest of the kernel, due to the extra space saving. The code will get compile checks when compiled with different architectures, and I'm not sure I understand the last point you made. > Either way, > > Acked-by: Chen-Yu Tsai <wens@csie.org> I've applied this to the patch. Thanks. > > { > > .id = "INT33F4", > > @@ -87,6 +88,7 @@ static const struct acpi_device_id axp20x_i2c_acpi_match[] = { > > { }, > > }; > > MODULE_DEVICE_TABLE(acpi, axp20x_i2c_acpi_match); > > +#endif > > > > static struct i2c_driver axp20x_i2c_driver = { > > .driver = { > > -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-06 7:31 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-29 12:32 [PATCH 0/5] Last batch of W=1 warning fixes in MFD Lee Jones 2020-06-29 12:32 ` Lee Jones 2020-06-29 12:32 ` [PATCH 1/5] mfd: si476x-cmd: Add missing documentation for si476x_cmd_fm_rds_status()'s arg 'report' Lee Jones 2020-06-29 12:32 ` Lee Jones 2020-06-29 12:32 ` [PATCH 2/5] mfd: lm3533-ctrlbank: Cap BRIGHTNESS_MAX to 127 since API uses u8 as carrier Lee Jones 2020-06-29 12:32 ` Lee Jones 2020-06-29 12:51 ` Johan Hovold 2020-06-29 12:51 ` Johan Hovold 2020-06-29 13:25 ` Lee Jones 2020-06-29 13:25 ` Lee Jones 2020-06-30 8:38 ` Johan Hovold 2020-06-30 8:38 ` Johan Hovold 2020-06-29 12:32 ` [PATCH 3/5] mfd: rave-sp: Fix mistake in 'struct rave_sp_deframer's kerneldoc Lee Jones 2020-06-29 12:32 ` Lee Jones 2020-06-29 12:32 ` [PATCH 4/5] mfd: sprd-sc27xx-spi: Fix divide by zero when allocating register offset/mask Lee Jones 2020-06-29 12:32 ` Lee Jones 2020-06-29 13:06 ` Johan Hovold 2020-06-29 13:06 ` Johan Hovold 2020-06-29 14:01 ` Lee Jones 2020-06-29 14:01 ` Lee Jones 2020-06-29 14:35 ` Baolin Wang 2020-06-29 14:35 ` Baolin Wang 2020-06-29 14:43 ` Johan Hovold 2020-06-29 14:43 ` Johan Hovold 2020-06-29 15:08 ` Baolin Wang 2020-06-29 15:08 ` Baolin Wang 2020-06-29 15:45 ` Lee Jones 2020-06-29 15:45 ` Lee Jones 2020-07-01 9:15 ` [PATCH] mfd: sprd-sc27xx-spi: Fix-up bogus IRQ register offset and mask setting Lee Jones 2020-07-01 9:15 ` Lee Jones 2020-07-01 14:10 ` Baolin Wang 2020-07-01 14:10 ` Baolin Wang 2020-06-29 12:32 ` [PATCH 5/5] mfd: axp20x-i2c: Do not define 'struct acpi_device_id' when !CONFIG_ACPI Lee Jones 2020-06-29 12:32 ` Lee Jones 2020-06-29 15:38 ` Chen-Yu Tsai 2020-06-29 15:38 ` Chen-Yu Tsai 2020-07-06 7:31 ` Lee Jones [this message] 2020-07-06 7:31 ` Lee Jones 2020-07-01 6:59 ` [PATCH v2] mfd: axp20x-i2c: Tell the compiler that ACPI functions may not be used Lee Jones 2020-07-01 6:59 ` Lee Jones 2020-07-01 8:38 ` Chen-Yu Tsai 2020-07-01 8:38 ` Chen-Yu Tsai
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=20200706073111.GD2821869@dell \ --to=lee.jones@linaro.org \ --cc=carlo@caione.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=wens@csie.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.