lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212150037.pXbbznkF-lkp@intel.com>
Date:   Thu, 15 Dec 2022 01:02:52 +0800
From:   kernel test robot <lkp@...el.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v1 1/2] iio: adc: ti-adc128s052: Switch to use
 spi_get_device_match_data()

Hi Andy,

I love your patch! Yet something to improve:

[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on next-20221214]
[cannot apply to linus/master v6.1]
[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/Andy-Shevchenko/iio-adc-ti-adc128s052-Switch-to-use-spi_get_device_match_data/20221214-195107
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20221214114944.83790-1-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 1/2] iio: adc: ti-adc128s052: Switch to use spi_get_device_match_data()
config: i386-randconfig-a002
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/intel-lab-lkp/linux/commit/bcf5eb0a92b2364ddde0d61a772ae31f2fbc4dae
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Andy-Shevchenko/iio-adc-ti-adc128s052-Switch-to-use-spi_get_device_match_data/20221214-195107
        git checkout bcf5eb0a92b2364ddde0d61a772ae31f2fbc4dae
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

>> drivers/iio/adc/ti-adc128s052.c:158:11: error: implicit declaration of function 'spi_get_device_match_data' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           config = spi_get_device_match_data(&spi->dev);
                    ^
   drivers/iio/adc/ti-adc128s052.c:158:9: warning: incompatible integer to pointer conversion assigning to 'const struct adc128_configuration *' from 'int' [-Wint-conversion]
           config = spi_get_device_match_data(&spi->dev);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/iio/adc/ti-adc128s052.c:160:37: error: array subscript is not an integer
           indio_dev->channels = adc128_config[config].channels;
                                              ^~~~~~~
   drivers/iio/adc/ti-adc128s052.c:161:41: error: array subscript is not an integer
           indio_dev->num_channels = adc128_config[config].num_channels;
                                                  ^~~~~~~
   1 warning and 3 errors generated.


vim +/spi_get_device_match_data +158 drivers/iio/adc/ti-adc128s052.c

   139	
   140	static int adc128_probe(struct spi_device *spi)
   141	{
   142		const struct adc128_configuration *config;
   143		struct iio_dev *indio_dev;
   144		struct adc128 *adc;
   145		int ret;
   146	
   147		indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adc));
   148		if (!indio_dev)
   149			return -ENOMEM;
   150	
   151		adc = iio_priv(indio_dev);
   152		adc->spi = spi;
   153	
   154		indio_dev->name = spi_get_device_id(spi)->name;
   155		indio_dev->modes = INDIO_DIRECT_MODE;
   156		indio_dev->info = &adc128_info;
   157	
 > 158		config = spi_get_device_match_data(&spi->dev);
   159	
 > 160		indio_dev->channels = adc128_config[config].channels;
   161		indio_dev->num_channels = adc128_config[config].num_channels;
   162	
   163		adc->reg = devm_regulator_get(&spi->dev, "vref");
   164		if (IS_ERR(adc->reg))
   165			return PTR_ERR(adc->reg);
   166	
   167		ret = regulator_enable(adc->reg);
   168		if (ret < 0)
   169			return ret;
   170		ret = devm_add_action_or_reset(&spi->dev, adc128_disable_regulator,
   171					       adc->reg);
   172		if (ret)
   173			return ret;
   174	
   175		mutex_init(&adc->lock);
   176	
   177		return devm_iio_device_register(&spi->dev, indio_dev);
   178	}
   179	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (168234 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ