Re: [PATCH v4 3/3] iio: addac: add AD74413R driver

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

 



Hi Cosmin,

I love your patch! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on robh/for-next linus/master v5.16-rc2 next-20211126]
[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/Cosmin-Tanislav/Add-AD74413R-driver/20211125-212256
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: ia64-allyesconfig (https://download.01.org/0day-ci/archive/20211126/202111261848.357oHcvz-lkp@xxxxxxxxx/config)
compiler: ia64-linux-gcc (GCC) 11.2.0
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://github.com/0day-ci/linux/commit/fc77dddb39ba26db2e5f66817f9e12dc3191659d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cosmin-Tanislav/Add-AD74413R-driver/20211125-212256
        git checkout fc77dddb39ba26db2e5f66817f9e12dc3191659d
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64 

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/iio/addac/ad74413r.c: In function 'ad74413r_range_to_voltage_offset_raw':
>> drivers/iio/addac/ad74413r.c:586:24: warning: overflow in conversion from 'long unsigned int' to 'int' changes value from '18446744073709486081' to '-65535' [-Woverflow]
     586 |                 *val = -AD74413R_ADC_RESULT_MAX;
         |                        ^
   drivers/iio/addac/ad74413r.c:589:24: warning: overflow in conversion from 'long unsigned int' to 'int' changes value from '9223372036854743040' to '-32768' [-Woverflow]
     589 |                 *val = -AD74413R_ADC_RESULT_MAX / 2;
         |                        ^


vim +586 drivers/iio/addac/ad74413r.c

   576	
   577	static int ad74413r_range_to_voltage_offset_raw(struct ad74413r_state *st,
   578							unsigned int range, int *val)
   579	{
   580		switch (range) {
   581		case AD74413R_ADC_RANGE_10V:
   582		case AD74413R_ADC_RANGE_2P5V_EXT_POW:
   583			*val = 0;
   584			return 0;
   585		case AD74413R_ADC_RANGE_2P5V_INT_POW:
 > 586			*val = -AD74413R_ADC_RESULT_MAX;
   587			return 0;
   588		case AD74413R_ADC_RANGE_5V_BI_DIR:
   589			*val = -AD74413R_ADC_RESULT_MAX / 2;
   590			return 0;
   591		default:
   592			dev_err(st->dev, "ADC range invalid\n");
   593			return -EINVAL;
   594		}
   595	}
   596	

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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux