CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Cixi Geng <[email protected]>
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
CC: [email protected]
CC: [email protected]

Hi Cixi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on v5.16-rc8 next-20220106]
[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]

url:    
https://github.com/0day-ci/linux/commits/Cixi-Geng/iio-adc-sc27xx-adjust-structure-and-add-PMIC-s-support/20220106-210151
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
:::::: branch date: 30 hours ago
:::::: commit date: 30 hours ago
config: openrisc-randconfig-m031-20220106 
(https://download.01.org/0day-ci/archive/20220108/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/iio/adc/sc27xx_adc.c:196 adc_nvmem_cell_calib_data() warn: passing zero 
to 'PTR_ERR'

Old smatch warnings:
drivers/iio/adc/sc27xx_adc.c:201 adc_nvmem_cell_calib_data() warn: passing zero 
to 'PTR_ERR'
drivers/iio/adc/sc27xx_adc.c:706 sc27xx_adc_read() error: uninitialized symbol 
'value'.
drivers/iio/adc/sc27xx_adc.c:1123 sc27xx_adc_probe() warn: passing zero to 
'PTR_ERR'

vim +/PTR_ERR +196 drivers/iio/adc/sc27xx_adc.c

8ba0dbfd07a358 Baolin Wang 2018-08-29  183  
87da8dcc76b4aa Cixi Geng   2022-01-06  184  static int 
adc_nvmem_cell_calib_data(struct sc27xx_adc_data *data, const char *cell_name)
87da8dcc76b4aa Cixi Geng   2022-01-06  185  {
87da8dcc76b4aa Cixi Geng   2022-01-06  186      struct nvmem_cell *cell;
87da8dcc76b4aa Cixi Geng   2022-01-06  187      void *buf;
87da8dcc76b4aa Cixi Geng   2022-01-06  188      u32 calib_data = 0;
87da8dcc76b4aa Cixi Geng   2022-01-06  189      size_t len = 0;
87da8dcc76b4aa Cixi Geng   2022-01-06  190  
87da8dcc76b4aa Cixi Geng   2022-01-06  191      if (!data)
87da8dcc76b4aa Cixi Geng   2022-01-06  192              return -EINVAL;
87da8dcc76b4aa Cixi Geng   2022-01-06  193  
87da8dcc76b4aa Cixi Geng   2022-01-06  194      cell = 
nvmem_cell_get(data->dev, cell_name);
87da8dcc76b4aa Cixi Geng   2022-01-06  195      if (IS_ERR_OR_NULL(cell))
87da8dcc76b4aa Cixi Geng   2022-01-06 @196              return PTR_ERR(cell);
87da8dcc76b4aa Cixi Geng   2022-01-06  197  
87da8dcc76b4aa Cixi Geng   2022-01-06  198      buf = nvmem_cell_read(cell, 
&len);
87da8dcc76b4aa Cixi Geng   2022-01-06  199      if (IS_ERR_OR_NULL(buf)) {
87da8dcc76b4aa Cixi Geng   2022-01-06  200              nvmem_cell_put(cell);
87da8dcc76b4aa Cixi Geng   2022-01-06  201              return PTR_ERR(buf);
87da8dcc76b4aa Cixi Geng   2022-01-06  202      }
87da8dcc76b4aa Cixi Geng   2022-01-06  203  
87da8dcc76b4aa Cixi Geng   2022-01-06  204      memcpy(&calib_data, buf, 
min(len, sizeof(u32)));
87da8dcc76b4aa Cixi Geng   2022-01-06  205  
87da8dcc76b4aa Cixi Geng   2022-01-06  206      kfree(buf);
87da8dcc76b4aa Cixi Geng   2022-01-06  207      nvmem_cell_put(cell);
87da8dcc76b4aa Cixi Geng   2022-01-06  208      return calib_data;
87da8dcc76b4aa Cixi Geng   2022-01-06  209  }
87da8dcc76b4aa Cixi Geng   2022-01-06  210  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to