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: <202212142029.rgtiwKJr-lkp@intel.com>
Date:   Wed, 14 Dec 2022 21:10:28 +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:     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! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING 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: ia64-allyesconfig
compiler: ia64-linux-gcc (GCC) 12.1.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/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=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/iio/adc/

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

All warnings (new ones prefixed by >>):

   drivers/iio/adc/ti-adc128s052.c: In function 'adc128_probe':
   drivers/iio/adc/ti-adc128s052.c:158:18: error: implicit declaration of function 'spi_get_device_match_data'; did you mean 'spi_get_device_id'? [-Werror=implicit-function-declaration]
     158 |         config = spi_get_device_match_data(&spi->dev);
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
         |                  spi_get_device_id
>> drivers/iio/adc/ti-adc128s052.c:158:16: warning: assignment to 'const struct adc128_configuration *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     158 |         config = spi_get_device_match_data(&spi->dev);
         |                ^
   drivers/iio/adc/ti-adc128s052.c:160:44: error: array subscript is not an integer
     160 |         indio_dev->channels = adc128_config[config].channels;
         |                                            ^
   drivers/iio/adc/ti-adc128s052.c:161:48: error: array subscript is not an integer
     161 |         indio_dev->num_channels = adc128_config[config].num_channels;
         |                                                ^
>> drivers/iio/adc/ti-adc128s052.c:142:44: warning: variable 'config' set but not used [-Wunused-but-set-variable]
     142 |         const struct adc128_configuration *config;
         |                                            ^~~~~~
   cc1: some warnings being treated as errors


vim +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" (322496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ