Re: [PATCH v5 2/2] iio: adc: Add driver support for MAX34408/9

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

 



Hi Ivan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on robh/for-next linus/master v6.6-rc5 next-20231009]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ivan-Mikhaylov/dt-bindings-adc-provide-max34408-9-device-tree-binding-document/20231008-074933
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20231007234838.8748-3-fr0st61te%40gmail.com
patch subject: [PATCH v5 2/2] iio: adc: Add driver support for MAX34408/9
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20231009/202310091704.gr3fx4Vo-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231009/202310091704.gr3fx4Vo-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310091704.gr3fx4Vo-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/iio/adc/max34408.c:240:31: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
     240 |                                          &max34408->input_rsense[i]);
         |                                                                  ^
   drivers/iio/adc/max34408.c:215:11: note: initialize the variable 'i' to silence this warning
     215 |         int rc, i;
         |                  ^
         |                   = 0
   1 warning generated.


vim +/i +240 drivers/iio/adc/max34408.c

   205	
   206	static int max34408_probe(struct i2c_client *client)
   207	{
   208		const struct max34408_adc_model_data *model_data;
   209		struct device *dev = &client->dev;
   210		const struct of_device_id *match;
   211		struct max34408_data *max34408;
   212		struct fwnode_handle *node;
   213		struct iio_dev *indio_dev;
   214		struct regmap *regmap;
   215		int rc, i;
   216	
   217		match = i2c_of_match_device(max34408_of_match, client);
   218		if (!match)
   219			return -EINVAL;
   220		model_data = i2c_get_match_data(client);
   221	
   222		regmap = devm_regmap_init_i2c(client, &max34408_regmap_config);
   223		if (IS_ERR(regmap)) {
   224			dev_err_probe(dev, PTR_ERR(regmap),
   225				      "regmap_init failed\n");
   226			return PTR_ERR(regmap);
   227		}
   228	
   229		indio_dev = devm_iio_device_alloc(dev, sizeof(*max34408));
   230		if (!indio_dev)
   231			return -ENOMEM;
   232	
   233		max34408 = iio_priv(indio_dev);
   234		max34408->regmap = regmap;
   235		max34408->dev = dev;
   236		mutex_init(&max34408->lock);
   237	
   238		device_for_each_child_node(dev, node) {
   239			fwnode_property_read_u32(node, "maxim,rsense-val-micro-ohms",
 > 240						 &max34408->input_rsense[i]);
   241			i++;
   242		}
   243	
   244		/* disable ALERT and averaging */
   245		rc = regmap_write(max34408->regmap, MAX34408_CONTROL_REG, 0x0);
   246		if (rc)
   247			return rc;
   248	
   249		indio_dev->channels = model_data->channels;
   250		indio_dev->num_channels = model_data->num_channels;
   251		indio_dev->name = model_data->model_name;
   252	
   253		indio_dev->info = &max34408_info;
   254		indio_dev->modes = INDIO_DIRECT_MODE;
   255	
   256		return devm_iio_device_register(dev, indio_dev);
   257	}
   258	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux