From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
linux-mips@vger.kernel.org
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org
Subject: Re: drivers/ata/ahci_st.c:229:34: warning: unused variable 'st_ahci_match'
Date: Thu, 13 Oct 2022 15:13:33 +0900 [thread overview]
Message-ID: <4517c95f-1dad-5a8c-5202-073d0a7eff29@opensource.wdc.com> (raw)
In-Reply-To: <202210121422.MJsXaw1M-lkp@intel.com>
On 10/12/22 15:37, kernel test robot wrote:
> Hi Damien,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 49da070062390094112b423ba443ea193527b2e4
> commit: ecf8322f464d62759d838ea62cdeff6966a60134 ata: ahci_st: Enable compile test
> date: 3 weeks ago
> config: mips-randconfig-r023-20221012
> compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install mips cross compiling tool for clang build
> # apt-get install binutils-mipsel-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ecf8322f464d62759d838ea62cdeff6966a60134
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout ecf8322f464d62759d838ea62cdeff6966a60134
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/ata/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
>>> drivers/ata/ahci_st.c:229:34: warning: unused variable 'st_ahci_match' [-Wunused-const-variable]
> static const struct of_device_id st_ahci_match[] = {
> ^
> 1 warning generated.
>
>
> vim +/st_ahci_match +229 drivers/ata/ahci_st.c
>
> 76884cb2f7da52 Lee Jones 2014-02-26 228
> 09de99db23df55 Kiran Padwal 2014-07-22 @229 static const struct of_device_id st_ahci_match[] = {
> 76884cb2f7da52 Lee Jones 2014-02-26 230 { .compatible = "st,ahci", },
> 5e776d7b20f040 Geert Uytterhoeven 2022-03-03 231 { /* sentinel */ }
> 76884cb2f7da52 Lee Jones 2014-02-26 232 };
> 76884cb2f7da52 Lee Jones 2014-02-26 233 MODULE_DEVICE_TABLE(of, st_ahci_match);
> 76884cb2f7da52 Lee Jones 2014-02-26 234
>
> :::::: The code at line 229 was first introduced by commit
> :::::: 09de99db23df55c7415d110f6c62281dedd77384 ahci: st: Make of_device_id array const
>
> :::::: TO: Kiran Padwal <kiran.padwal21@gmail.com>
> :::::: CC: Tejun Heo <tj@kernel.org>
I am at a loss with this one... There are plenty of patterns similar to
drivers/ata/ahci_st.c doing something like:
static const struct of_device_id st_ahci_match[] = {
{ .compatible = "st,ahci", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, st_ahci_match);
For instance, in drivers/pwm/pwm-sti.c, we have:
static const struct of_device_id sti_pwm_of_match[] = {
{ .compatible = "st,sti-pwm", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, sti_pwm_of_match);
And countless others like this for STI and other arch too.
So if CONFIG_MODULE is not enabled, how come we are not submerged with
warnings about unused variables ? Is mips arch special in this regard ?
Or am I missing something ?
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2022-10-13 6:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 6:37 kernel test robot
2022-10-13 6:13 ` Damien Le Moal [this message]
2022-10-13 7:33 ` Arnd Bergmann
2022-10-13 7:48 ` Damien Le Moal
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=4517c95f-1dad-5a8c-5202-073d0a7eff29@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=tsbogend@alpha.franken.de \
/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®