From: Jonathan Cameron <jic23@kernel.org>
To: Ben Dooks <ben.dooks@codethink.co.uk>
Cc: linux-iio@vger.kernel.org, lars@metafoo.de
Subject: Re: [PATCH] iio: proximity: isl29501: fix unused of_device_id table
Date: Sat, 9 Mar 2024 17:35:25 +0000 [thread overview]
Message-ID: <20240309173525.1015c30e@jic23-huawei> (raw)
In-Reply-To: <20240308180718.1913090-1-ben.dooks@codethink.co.uk>
On Fri, 8 Mar 2024 18:07:18 +0000
Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> Under certain build conditions, the following warning is being generated
> from the isl29501 driver due to OF being configured but the driver being
> built in.
>
> drivers/iio/proximity/isl29501.c:999:34: warning: ‘isl29501_i2c_matches’ defined but not used [-Wunused-const-variable=]
> 999 | static const struct of_device_id isl29501_i2c_matches[] = {
>
> The isl29501_i2c_matches[] is only passed to MODULE_DEVICE_TABLE() and thus is
> not referenced if the driver is built into the kernel. Fix by adding a check
> for MODULE around the #if block.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Hi Ben,
Already applied a different fix for this which is to allow matching via the
table.
Thanks
Jonathan
> ---
> drivers/iio/proximity/isl29501.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/proximity/isl29501.c b/drivers/iio/proximity/isl29501.c
> index bcebacaf3dab..d509227f47b7 100644
> --- a/drivers/iio/proximity/isl29501.c
> +++ b/drivers/iio/proximity/isl29501.c
> @@ -995,7 +995,7 @@ static const struct i2c_device_id isl29501_id[] = {
>
> MODULE_DEVICE_TABLE(i2c, isl29501_id);
>
> -#if defined(CONFIG_OF)
> +#if defined(CONFIG_OF) && defined(MODULE)
> static const struct of_device_id isl29501_i2c_matches[] = {
> { .compatible = "renesas,isl29501" },
> { }
prev parent reply other threads:[~2024-03-09 17:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 18:07 [PATCH] iio: proximity: isl29501: fix unused of_device_id table Ben Dooks
2024-03-09 17:35 ` Jonathan Cameron [this message]
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=20240309173525.1015c30e@jic23-huawei \
--to=jic23@kernel.org \
--cc=ben.dooks@codethink.co.uk \
--cc=lars@metafoo.de \
--cc=linux-iio@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