Re: [PATCH v4 3/3] drivers: iio: adc: add support for ad777x family

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

 



Hi Ramona,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.10 next-20240724]
[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/Ramona-Alexandra-Nechita/dt-bindings-iio-adc-add-a7779-doc/20240725-000001
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20240724155517.12470-5-ramona.nechita%40analog.com
patch subject: [PATCH v4 3/3] drivers: iio: adc: add support for ad777x family
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240725/202407251042.LUZ78skF-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240725/202407251042.LUZ78skF-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/202407251042.LUZ78skF-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/iio/adc/ad7779.c:420:5: warning: unused variable 'low' [-Wunused-variable]
     420 |         u8 low, mid, high;
         |            ^~~
   drivers/iio/adc/ad7779.c:420:10: warning: unused variable 'mid' [-Wunused-variable]
     420 |         u8 low, mid, high;
         |                 ^~~
   drivers/iio/adc/ad7779.c:420:15: warning: unused variable 'high' [-Wunused-variable]
     420 |         u8 low, mid, high;
         |                      ^~~~
   drivers/iio/adc/ad7779.c:445:5: warning: variable 'msb' set but not used [-Wunused-but-set-variable]
     445 |         u8 msb, mid, lsb;
         |            ^
   drivers/iio/adc/ad7779.c:445:10: warning: variable 'mid' set but not used [-Wunused-but-set-variable]
     445 |         u8 msb, mid, lsb;
         |                 ^
   drivers/iio/adc/ad7779.c:445:15: warning: variable 'lsb' set but not used [-Wunused-but-set-variable]
     445 |         u8 msb, mid, lsb;
         |                      ^
   drivers/iio/adc/ad7779.c:475:6: warning: unused variable 'ret' [-Wunused-variable]
     475 |         int ret;
         |             ^~~
>> drivers/iio/adc/ad7779.c:779:35: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
     779 |                 return dev_err_probe(&spi->dev, ret,
         |                                                 ^~~
   drivers/iio/adc/ad7779.c:766:9: note: initialize the variable 'ret' to silence this warning
     766 |         int ret;
         |                ^
         |                 = 0
   8 warnings generated.


vim +/ret +779 drivers/iio/adc/ad7779.c

   760	
   761	static int ad7779_probe(struct spi_device *spi)
   762	{
   763		struct iio_dev *indio_dev;
   764		struct ad7779_state *st;
   765		struct gpio_desc *reset_gpio, *start_gpio;
   766		int ret;
   767	
   768		indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
   769		if (!indio_dev)
   770			return -ENOMEM;
   771	
   772		st = iio_priv(indio_dev);
   773	
   774		st->mclk = devm_clk_get_enabled(&spi->dev, "mclk");
   775		if (IS_ERR(st->mclk))
   776			return PTR_ERR(st->mclk);
   777	
   778		if (!spi->irq)
 > 779			return dev_err_probe(&spi->dev, ret,
   780					     "DRDY irq not present\n"); 
   781	
   782		reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_LOW);
   783		if (IS_ERR(reset_gpio))
   784			return PTR_ERR(reset_gpio);
   785	
   786		start_gpio = devm_gpiod_get(&spi->dev, "start", GPIOD_OUT_HIGH);
   787		if (IS_ERR(start_gpio))
   788			return PTR_ERR(start_gpio);
   789	
   790		crc8_populate_msb(ad7779_crc8_table, AD7779_CRC8_POLY);
   791		st->spi = spi;
   792	
   793		st->chip_info = spi_get_device_match_data(spi);
   794		if (!st->chip_info)
   795			return -ENODEV;
   796	
   797		ret = ad7779_reset(indio_dev, start_gpio);
   798		if (ret)
   799			return ret;
   800	
   801		ad7779_powerup(st, start_gpio);
   802		if (ret)
   803			return ret;
   804	
   805		indio_dev->name = st->chip_info->name;
   806		indio_dev->info = &ad7779_info;
   807		indio_dev->modes = INDIO_DIRECT_MODE;
   808		indio_dev->channels = st->chip_info->channels;
   809		indio_dev->num_channels = ARRAY_SIZE(ad7779_channels);
   810	
   811		st->trig = devm_iio_trigger_alloc(&spi->dev, "%s-dev%d",
   812						  		indio_dev->name, iio_device_id(indio_dev));
   813		if (!st->trig)
   814			return -ENOMEM;
   815	
   816		st->trig->ops= &ad7779_trigger_ops;
   817		st->trig->dev.parent = &spi->dev;
   818	
   819		iio_trigger_set_drvdata(st->trig, st);
   820	
   821		ret = devm_request_irq(&spi->dev, spi->irq,
   822							   iio_trigger_generic_data_rdy_poll,
   823							   IRQF_ONESHOT | IRQF_NO_AUTOEN,
   824							   indio_dev->name, st->trig);
   825		if (ret)
   826			return dev_err_probe(&spi->dev, ret, "request irq %d failed\n",
   827					     st->spi->irq);
   828	
   829		ret = devm_iio_trigger_register(&spi->dev, st->trig);
   830		if (ret)
   831			return ret;
   832	
   833		indio_dev->trig = iio_trigger_get(st->trig);
   834	
   835		init_completion(&st->completion);
   836	
   837		ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev,
   838											  &iio_pollfunc_store_time,
   839											  &ad7779_trigger_handler,
   840											  &ad7779_buffer_setup_ops);
   841		if (ret)
   842			return ret;
   843	
   844		ret = ad7779_spi_write_mask(st, AD7779_REG_DOUT_FORMAT,
   845					    AD7779_DCLK_CLK_DIV_MSK,
   846					    FIELD_PREP(AD7779_DCLK_CLK_DIV_MSK, 7));
   847		if (ret)
   848			return ret;
   849	
   850		return devm_iio_device_register(&spi->dev, indio_dev);
   851	}
   852	

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