linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id'
@ 2020-06-23 13:58 kernel test robot
  2020-06-26  6:42 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2020-06-23 13:58 UTC (permalink / raw)
  To: Tomer Maimon
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu, Daniel Thompson

[-- Attachment #1: Type: text/plain, Size: 1676 bytes --]

Hi Tomer,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd0d718152e4c65b173070d48ea9dfc06894c3e5
commit: c98429297d8b25a0d9c48d8e1f5237f19412f07b hwrng: npcm - add NPCM RNG driver
date:   9 months ago
config: x86_64-randconfig-r004-20200623 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 1d4c87335d5236ea1f35937e1014980ba961ae34)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout c98429297d8b25a0d9c48d8e1f5237f19412f07b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id' [-Wunused-const-variable]
   static const struct of_device_id rng_dt_id[] = {
                                    ^
   1 warning generated.

vim +/rng_dt_id +166 drivers/char/hw_random/npcm-rng.c

   165	
 > 166	static const struct of_device_id rng_dt_id[] = {
   167		{ .compatible = "nuvoton,npcm750-rng",  },
   168		{},
   169	};
   170	MODULE_DEVICE_TABLE(of, rng_dt_id);
   171	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37856 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id'
  2020-06-23 13:58 drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id' kernel test robot
@ 2020-06-26  6:42 ` Herbert Xu
  2020-06-26  6:52   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2020-06-26  6:42 UTC (permalink / raw)
  To: kernel test robot
  Cc: Tomer Maimon, kbuild-all, clang-built-linux, linux-kernel,
	Daniel Thompson

On Tue, Jun 23, 2020 at 09:58:39PM +0800, kernel test robot wrote:
>
> >> drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id' [-Wunused-const-variable]
>    static const struct of_device_id rng_dt_id[] = {
>                                     ^
>    1 warning generated.

The kernel is supposed to be built with -Wno-unused-const-variable,
so I guess this is a deficiency in clang.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id'
  2020-06-26  6:42 ` Herbert Xu
@ 2020-06-26  6:52   ` Nathan Chancellor
  2020-06-29  8:02     ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2020-06-26  6:52 UTC (permalink / raw)
  To: Herbert Xu
  Cc: kernel test robot, Tomer Maimon, kbuild-all, clang-built-linux,
	linux-kernel, Daniel Thompson

On Fri, Jun 26, 2020 at 04:42:25PM +1000, Herbert Xu wrote:
> On Tue, Jun 23, 2020 at 09:58:39PM +0800, kernel test robot wrote:
> >
> > >> drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id' [-Wunused-const-variable]
> >    static const struct of_device_id rng_dt_id[] = {
> >                                     ^
> >    1 warning generated.
> 
> The kernel is supposed to be built with -Wno-unused-const-variable,
> so I guess this is a deficiency in clang.
> 
> Cheers,
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> 

No deficiency in clang, it's a W=1 build, which explicitly enables
-Wunused-const-variable per scripts/Kbuild.extrawarn. The 0day team
decided to enable W=1 for all build tests, hence the comment in the
reproduce notes. A thread with discussion:

https://lore.kernel.org/lkml/202005200123.gFjGzJEH%25lkp@intel.com/

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id'
  2020-06-26  6:52   ` Nathan Chancellor
@ 2020-06-29  8:02     ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2020-06-29  8:02 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, Tomer Maimon, kbuild-all, clang-built-linux,
	linux-kernel, Daniel Thompson

On Thu, Jun 25, 2020 at 11:52:47PM -0700, Nathan Chancellor wrote:
>
> No deficiency in clang, it's a W=1 build, which explicitly enables
> -Wunused-const-variable per scripts/Kbuild.extrawarn. The 0day team
> decided to enable W=1 for all build tests, hence the comment in the
> reproduce notes. A thread with discussion:
> 
> https://lore.kernel.org/lkml/202005200123.gFjGzJEH%25lkp@intel.com/

Fair enough.  I'll fix this by adding __maybe_unused.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-29 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23 13:58 drivers/char/hw_random/npcm-rng.c:166:34: warning: unused variable 'rng_dt_id' kernel test robot
2020-06-26  6:42 ` Herbert Xu
2020-06-26  6:52   ` Nathan Chancellor
2020-06-29  8:02     ` Herbert Xu

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).