[mkl-can-next:mcp25xxfd-cleanup 36/36] include/linux/device.h:1140:19: warning: 'priv' may be used uninitialized in this function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/mkl/linux-can-next.git mcp25xxfd-cleanup
head:   17febc39531653c6cdc996d99b8fc0748f0aabd7
commit: 17febc39531653c6cdc996d99b8fc0748f0aabd7 [36/36] wip
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 17febc39531653c6cdc996d99b8fc0748f0aabd7
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   In file included from include/linux/node.h:18:0,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/net/can/spi/mcp25xxfd/mcp25xxfd_base.c:11:
   drivers/net/can/spi/mcp25xxfd/mcp25xxfd_base.c: In function 'mcp25xxfd_base_probe':
>> include/linux/device.h:1140:19: warning: 'priv' may be used uninitialized in this function [-Wmaybe-uninitialized]
     dev->driver_data = data;
     ~~~~~~~~~~~~~~~~~^~~~~~
   drivers/net/can/spi/mcp25xxfd/mcp25xxfd_base.c:74:25: note: 'priv' was declared here
     struct mcp25xxfd_priv *priv;
                            ^~~~
--
   In file included from include/linux/node.h:18:0,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/net//can/spi/mcp25xxfd/mcp25xxfd_base.c:11:
   drivers/net//can/spi/mcp25xxfd/mcp25xxfd_base.c: In function 'mcp25xxfd_base_probe':
>> include/linux/device.h:1140:19: warning: 'priv' may be used uninitialized in this function [-Wmaybe-uninitialized]
     dev->driver_data = data;
     ~~~~~~~~~~~~~~~~~^~~~~~
   drivers/net//can/spi/mcp25xxfd/mcp25xxfd_base.c:74:25: note: 'priv' was declared here
     struct mcp25xxfd_priv *priv;
                            ^~~~

vim +/priv +1140 include/linux/device.h

a996d010b64878 Jean Delvare 2014-04-14  1137  
a996d010b64878 Jean Delvare 2014-04-14  1138  static inline void dev_set_drvdata(struct device *dev, void *data)
a996d010b64878 Jean Delvare 2014-04-14  1139  {
a996d010b64878 Jean Delvare 2014-04-14 @1140  	dev->driver_data = data;
a996d010b64878 Jean Delvare 2014-04-14  1141  }
a996d010b64878 Jean Delvare 2014-04-14  1142  

:::::: The code at line 1140 was first introduced by commit
:::::: a996d010b648788b615938f6a26be6cf08d96aaf driver core: Inline dev_set/get_drvdata

:::::: TO: Jean Delvare <jdelvare@xxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux