From: Javier Martinez Canillas <javierm@redhat.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: kernel test robot <lkp@intel.com>,
llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: drivers/gpu/drm/solomon/ssd130x-spi.c:154:35: warning: unused variable 'ssd130x_spi_table'
Date: Mon, 30 May 2022 16:13:48 +0200 [thread overview]
Message-ID: <a806fe1c-0e48-7936-26a4-fb3fd8270300@redhat.com> (raw)
In-Reply-To: <0a3c11c7-2669-ca85-69d1-3b3faa2f7a3c@redhat.com>
On 5/29/22 09:34, Javier Martinez Canillas wrote:
> Hello Nathan,
[snip]
>>
>> You'll see the same warning with GCC and a similar configuration:
>>
>
> Yes, I'm not saying that the compiler warning is a false positive but
> that the reported error for this driver is. Since the correct fix on
> a driver that support SPI platform devices would be to use the table
> and set it to the struct spi_driver .id field.
>
>> drivers/gpu/drm/solomon/ssd130x-spi.c:154:35: error: ‘ssd130x_spi_table’ defined but not used [-Werror=unused-const-variable=]
>> 154 | static const struct spi_device_id ssd130x_spi_table[] = {
>> | ^~~~~~~~~~~~~~~~~
>> cc1: all warnings being treated as errors
>>
>> At the end of the day, this warning only shows up under W=1, so take it
>> as you will. The kernel test robot is a sign, not a cop :)
>>
>
> I guess something that could be done is to guard the definition of the
> ssd130x_spi_table with a `if IS_MODULE(CONFIG_DRM_SSD130X_SPI)`, since
> if the symbol is 'y' and the driver built-in, then won't be used indeed.
>
I posted https://lists.freedesktop.org/archives/dri-devel/2022-May/357088.html
to fix this compile warning. Thanks folks!
--
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
prev parent reply other threads:[~2022-05-30 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-28 20:58 kernel test robot
2022-05-28 21:23 ` Javier Martinez Canillas
2022-05-29 1:01 ` Nathan Chancellor
2022-05-29 7:34 ` Javier Martinez Canillas
2022-05-30 14:13 ` Javier Martinez Canillas [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=a806fe1c-0e48-7936-26a4-fb3fd8270300@redhat.com \
--to=javierm@redhat.com \
--cc=geert+renesas@glider.be \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nathan@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
all inboxes | Powered by JetHome®