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: <202412210010.ddQlStza-lkp@intel.com>
Date: Sat, 21 Dec 2024 00:39:06 +0800
From: kernel test robot <lkp@...el.com>
To: Esteban Blanc <eblanc@...libre.com>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Michael Hennerich <Michael.Hennerich@...log.com>,
	Nuno Sá <nuno.sa@...log.com>,
	Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Jonathan Corbet <corbet@....net>
Cc: oe-kbuild-all@...ts.linux.dev, linux-iio@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org, Esteban Blanc <eblanc@...libre.com>
Subject: Re: [PATCH v2 2/6] iio: adc: ad4030: add driver for ad4030-24

Hi Esteban,

kernel test robot noticed the following build errors:

[auto build test ERROR on 40384c840ea1944d7c5a392e8975ed088ecf0b37]

url:    https://github.com/intel-lab-lkp/linux/commits/Esteban-Blanc/dt-bindings-iio-adc-add-ADI-ad4030-ad4630-and-ad4632/20241220-001408
base:   40384c840ea1944d7c5a392e8975ed088ecf0b37
patch link:    https://lore.kernel.org/r/20241219-eblanc-ad4630_v1-v2-2-f36e55907bf5%40baylibre.com
patch subject: [PATCH v2 2/6] iio: adc: ad4030: add driver for ad4030-24
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20241221/202412210010.ddQlStza-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241221/202412210010.ddQlStza-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412210010.ddQlStza-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/iio/adc/ad4030.c: In function 'ad4030_get_chan_calibscale':
>> drivers/iio/adc/ad4030.c:346:16: error: implicit declaration of function 'get_unaligned_be16' [-Wimplicit-function-declaration]
     346 |         gain = get_unaligned_be16(st->rx_data.raw);
         |                ^~~~~~~~~~~~~~~~~~
   drivers/iio/adc/ad4030.c: In function 'ad4030_get_chan_calibbias':
>> drivers/iio/adc/ad4030.c:375:38: error: implicit declaration of function 'get_unaligned_be24' [-Wimplicit-function-declaration]
     375 |                 *val = sign_extend32(get_unaligned_be24(st->rx_data.raw), 23);
         |                                      ^~~~~~~~~~~~~~~~~~
   drivers/iio/adc/ad4030.c: In function 'ad4030_set_chan_calibscale':
>> drivers/iio/adc/ad4030.c:399:9: error: implicit declaration of function 'put_unaligned_be16' [-Wimplicit-function-declaration]
     399 |         put_unaligned_be16(DIV_ROUND_CLOSEST_ULL(gain * 0x8000, MICRO),
         |         ^~~~~~~~~~~~~~~~~~
   drivers/iio/adc/ad4030.c: In function 'ad4030_set_chan_calibbias':
>> drivers/iio/adc/ad4030.c:424:17: error: implicit declaration of function 'put_unaligned_be24' [-Wimplicit-function-declaration]
     424 |                 put_unaligned_be24(offset, st->tx_data);
         |                 ^~~~~~~~~~~~~~~~~~


vim +/get_unaligned_be16 +346 drivers/iio/adc/ad4030.c

   331	
   332	static int ad4030_get_chan_calibscale(struct iio_dev *indio_dev,
   333					      struct iio_chan_spec const *chan,
   334					      int *val,
   335					      int *val2)
   336	{
   337		struct ad4030_state *st = iio_priv(indio_dev);
   338		u16 gain;
   339		int ret;
   340	
   341		ret = regmap_bulk_read(st->regmap, AD4030_REG_GAIN_CHAN(chan->address),
   342				       st->rx_data.raw, AD4030_REG_GAIN_BYTES_NB);
   343		if (ret)
   344			return ret;
   345	
 > 346		gain = get_unaligned_be16(st->rx_data.raw);
   347	
   348		/* From datasheet: multiplied output = input × gain word/0x8000 */
   349		*val = gain / 0x8000;
   350		*val2 = mul_u64_u32_div(gain % 0x8000, NANO, 0x8000);
   351	
   352		return IIO_VAL_INT_PLUS_NANO;
   353	}
   354	
   355	/* Returns the offset where 1 LSB = (VREF/2^precision_bits - 1)/gain */
   356	static int ad4030_get_chan_calibbias(struct iio_dev *indio_dev,
   357					     struct iio_chan_spec const *chan,
   358					     int *val)
   359	{
   360		struct ad4030_state *st = iio_priv(indio_dev);
   361		int ret;
   362	
   363		ret = regmap_bulk_read(st->regmap,
   364				       AD4030_REG_OFFSET_CHAN(chan->address),
   365				       st->rx_data.raw, AD4030_REG_OFFSET_BYTES_NB);
   366		if (ret)
   367			return ret;
   368	
   369		switch (st->chip->precision_bits) {
   370		case 16:
   371			*val = sign_extend32(get_unaligned_be16(st->rx_data.raw), 15);
   372			return IIO_VAL_INT;
   373	
   374		case 24:
 > 375			*val = sign_extend32(get_unaligned_be24(st->rx_data.raw), 23);
   376			return IIO_VAL_INT;
   377	
   378		default:
   379			return -EINVAL;
   380		}
   381	}
   382	
   383	static int ad4030_set_chan_calibscale(struct iio_dev *indio_dev,
   384					      struct iio_chan_spec const *chan,
   385					      int gain_int,
   386					      int gain_frac)
   387	{
   388		struct ad4030_state *st = iio_priv(indio_dev);
   389		u64 gain;
   390	
   391		if (gain_int < 0 || gain_frac < 0)
   392			return -EINVAL;
   393	
   394		gain = mul_u32_u32(gain_int, MICRO) + gain_frac;
   395	
   396		if (gain > AD4030_REG_GAIN_MAX_GAIN)
   397			return -EINVAL;
   398	
 > 399		put_unaligned_be16(DIV_ROUND_CLOSEST_ULL(gain * 0x8000, MICRO),
   400				   st->tx_data);
   401	
   402		return regmap_bulk_write(st->regmap,
   403					 AD4030_REG_GAIN_CHAN(chan->address),
   404					 st->tx_data, AD4030_REG_GAIN_BYTES_NB);
   405	}
   406	
   407	static int ad4030_set_chan_calibbias(struct iio_dev *indio_dev,
   408					     struct iio_chan_spec const *chan,
   409					     int offset)
   410	{
   411		struct ad4030_state *st = iio_priv(indio_dev);
   412	
   413		if (offset < st->offset_avail[0] || offset > st->offset_avail[2])
   414			return -EINVAL;
   415	
   416		st->tx_data[2] = 0;
   417	
   418		switch (st->chip->precision_bits) {
   419		case 16:
   420			put_unaligned_be16(offset, st->tx_data);
   421			break;
   422	
   423		case 24:
 > 424			put_unaligned_be24(offset, st->tx_data);
   425			break;
   426	
   427		default:
   428			return -EINVAL;
   429		}
   430	
   431		return regmap_bulk_write(st->regmap,
   432					 AD4030_REG_OFFSET_CHAN(chan->address),
   433					 st->tx_data, AD4030_REG_OFFSET_BYTES_NB);
   434	}
   435	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ