public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/regulator/mt6380-regulator.c:333:34: warning: 'mt6380_of_match' defined but not used
@ 2022-07-23 18:37 kernel test robot
  2022-07-25  8:00 ` Jean Delvare
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-07-23 18:37 UTC (permalink / raw)
  To: Sean Wang; +Cc: kbuild-all, linux-kernel, Matthias Brugger, Jean Delvare

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   515f71412bb73ebd7f41f90e1684fc80b8730789
commit: 31d7b359a94b8c96e54c6e3b438e6c7b65b9acb1 soc: mediatek: place Kconfig for all SoC drivers under menu
date:   4 years, 9 months ago
config: i386-buildonly-randconfig-r004-20220718 (https://download.01.org/0day-ci/archive/20220724/202207240252.ZY5hSCNB-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=31d7b359a94b8c96e54c6e3b438e6c7b65b9acb1
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 31d7b359a94b8c96e54c6e3b438e6c7b65b9acb1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/crypto/ drivers/i2c/busses/ drivers/mailbox/ drivers/misc/eeprom/ drivers/regulator/ drivers/soc/mediatek/ drivers/soc/qcom/

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/regulator/mt6380-regulator.c:333:34: warning: 'mt6380_of_match' defined but not used [-Wunused-const-variable=]
     333 | static const struct of_device_id mt6380_of_match[] = {
         |                                  ^~~~~~~~~~~~~~~
--
>> drivers/soc/mediatek/mtk-pmic-wrap.c:1436:34: warning: 'of_pwrap_match_tbl' defined but not used [-Wunused-const-variable=]
    1436 | static const struct of_device_id of_pwrap_match_tbl[] = {
         |                                  ^~~~~~~~~~~~~~~~~~
>> drivers/soc/mediatek/mtk-pmic-wrap.c:1370:34: warning: 'of_slave_match_tbl' defined but not used [-Wunused-const-variable=]
    1370 | static const struct of_device_id of_slave_match_tbl[] = {
         |                                  ^~~~~~~~~~~~~~~~~~


vim +/mt6380_of_match +333 drivers/regulator/mt6380-regulator.c

a551e27368dea2 Chenglin Xu 2017-08-15  332  
a551e27368dea2 Chenglin Xu 2017-08-15 @333  static const struct of_device_id mt6380_of_match[] = {
a551e27368dea2 Chenglin Xu 2017-08-15  334  	{ .compatible = "mediatek,mt6380-regulator", },
a551e27368dea2 Chenglin Xu 2017-08-15  335  	{ /* sentinel */ },
a551e27368dea2 Chenglin Xu 2017-08-15  336  };
a551e27368dea2 Chenglin Xu 2017-08-15  337  MODULE_DEVICE_TABLE(of, mt6380_of_match);
a551e27368dea2 Chenglin Xu 2017-08-15  338  

:::::: The code at line 333 was first introduced by commit
:::::: a551e27368dea202cbef3e8861c21d965427cfe6 regulator: mt6380: Add support for MT6380

:::::: TO: Chenglin Xu <chenglin.xu@mediatek.com>
:::::: CC: Mark Brown <broonie@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: drivers/regulator/mt6380-regulator.c:333:34: warning: 'mt6380_of_match' defined but not used
  2022-07-23 18:37 drivers/regulator/mt6380-regulator.c:333:34: warning: 'mt6380_of_match' defined but not used kernel test robot
@ 2022-07-25  8:00 ` Jean Delvare
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2022-07-25  8:00 UTC (permalink / raw)
  To: kernel test robot; +Cc: Sean Wang, kbuild-all, linux-kernel, Matthias Brugger

On Sun, 24 Jul 2022 02:37:15 +0800, kernel test robot wrote:
> All warnings (new ones prefixed by >>):
> 
> >> drivers/regulator/mt6380-regulator.c:333:34: warning: 'mt6380_of_match' defined but not used [-Wunused-const-variable=]  
>      333 | static const struct of_device_id mt6380_of_match[] = {
>          |                                  ^~~~~~~~~~~~~~~
> --
> >> drivers/soc/mediatek/mtk-pmic-wrap.c:1436:34: warning: 'of_pwrap_match_tbl' defined but not used [-Wunused-const-variable=]  
>     1436 | static const struct of_device_id of_pwrap_match_tbl[] = {
>          |                                  ^~~~~~~~~~~~~~~~~~
> >> drivers/soc/mediatek/mtk-pmic-wrap.c:1370:34: warning: 'of_slave_match_tbl' defined but not used [-Wunused-const-variable=]  
>     1370 | static const struct of_device_id of_slave_match_tbl[] = {
>          |                                  ^~~~~~~~~~~~~~~~~~

Not sure what do to with this one. These warnings can be silenced with
__maybe_unused. But does it actually make sense to build these drivers
with CONFIG_OF disabled?

As I understand it, that's the condition which makes the warnings
appear, and from a quick look at the code, it seems to me that the
drivers are useless then. It might make more sense to make both drivers
depend on OF. What do you think?

-- 
Jean Delvare
SUSE L3 Support

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

end of thread, other threads:[~2022-07-25  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-23 18:37 drivers/regulator/mt6380-regulator.c:333:34: warning: 'mt6380_of_match' defined but not used kernel test robot
2022-07-25  8:00 ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox