[linux-next:master 10020/11353] drivers/i3c/master.c:2200:3: warning: variable 'i2cdev' is uninitialized when used here

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   cb153b68ff91cbc434f3de70ac549e110543e1bb
commit: 31b9887c7258ca47d9c665a80f19f006c86756b1 [10020/11353] i3c: remove i2c board info from i2c_dev_desc
config: hexagon-randconfig-r041-20220307 (https://download.01.org/0day-ci/archive/20220308/202203082147.hks5e2ec-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=31b9887c7258ca47d9c665a80f19f006c86756b1
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 31b9887c7258ca47d9c665a80f19f006c86756b1
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/i3c/

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

All warnings (new ones prefixed by >>):

>> drivers/i3c/master.c:2200:3: warning: variable 'i2cdev' is uninitialized when used here [-Wuninitialized]
                   i2cdev->dev = i2c_new_client_device(adap, &i2cboardinfo->base);
                   ^~~~~~
   drivers/i3c/master.c:2178:29: note: initialize the variable 'i2cdev' to silence this warning
           struct i2c_dev_desc *i2cdev;
                                      ^
                                       = NULL
   1 warning generated.


vim +/i2cdev +2200 drivers/i3c/master.c

  2174	
  2175	static int i3c_master_i2c_adapter_init(struct i3c_master_controller *master)
  2176	{
  2177		struct i2c_adapter *adap = i3c_master_to_i2c_adapter(master);
  2178		struct i2c_dev_desc *i2cdev;
  2179		struct i2c_dev_boardinfo *i2cboardinfo;
  2180		int ret;
  2181	
  2182		adap->dev.parent = master->dev.parent;
  2183		adap->owner = master->dev.parent->driver->owner;
  2184		adap->algo = &i3c_master_i2c_algo;
  2185		strncpy(adap->name, dev_name(master->dev.parent), sizeof(adap->name));
  2186	
  2187		/* FIXME: Should we allow i3c masters to override these values? */
  2188		adap->timeout = 1000;
  2189		adap->retries = 3;
  2190	
  2191		ret = i2c_add_adapter(adap);
  2192		if (ret)
  2193			return ret;
  2194	
  2195		/*
  2196		 * We silently ignore failures here. The bus should keep working
  2197		 * correctly even if one or more i2c devices are not registered.
  2198		 */
  2199		list_for_each_entry(i2cboardinfo, &master->boardinfo.i2c, node)
> 2200			i2cdev->dev = i2c_new_client_device(adap, &i2cboardinfo->base);
  2201	
  2202		return 0;
  2203	}
  2204	

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




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

  Powered by Linux