public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Lechner <dlechner@baylibre.com>,
	Jonathan Cameron <jic23@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org,
	"David Lechner" <dlechner@baylibre.com>
Subject: Re: [PATCH 2/4] iio: adc: ad4695: implement calibration support
Date: Wed, 21 Aug 2024 12:21:09 +0800	[thread overview]
Message-ID: <202408211207.fmYTjQDK-lkp@intel.com> (raw)
In-Reply-To: <20240820-ad4695-gain-offset-v1-2-c8f6e3b47551@baylibre.com>

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 0f718e10da81446df0909c9939dff2b77e3b4e95]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Lechner/iio-adc-ad4695-add-2nd-regmap-for-16-bit-registers/20240821-000102
base:   0f718e10da81446df0909c9939dff2b77e3b4e95
patch link:    https://lore.kernel.org/r/20240820-ad4695-gain-offset-v1-2-c8f6e3b47551%40baylibre.com
patch subject: [PATCH 2/4] iio: adc: ad4695: implement calibration support
config: i386-buildonly-randconfig-002-20240821 (https://download.01.org/0day-ci/archive/20240821/202408211207.fmYTjQDK-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240821/202408211207.fmYTjQDK-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408211207.fmYTjQDK-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/iio/adc/ad4695.c:735:6: warning: unused variable 'ret' [-Wunused-variable]
     735 |         int ret;
         |             ^~~
   1 warning generated.


vim +/ret +735 drivers/iio/adc/ad4695.c

   728	
   729	static int ad4695_write_raw(struct iio_dev *indio_dev,
   730				    struct iio_chan_spec const *chan,
   731				    int val, int val2, long mask)
   732	{
   733		struct ad4695_state *st = iio_priv(indio_dev);
   734		unsigned int reg_val;
 > 735		int ret;
   736	
   737		iio_device_claim_direct_scoped(return -EBUSY, indio_dev) {
   738			switch (mask) {
   739			case IIO_CHAN_INFO_CALIBSCALE:
   740				switch (chan->type) {
   741				case IIO_VOLTAGE:
   742					if (val < 0 || val2 < 0)
   743						reg_val = 0;
   744					else if (val > 1)
   745						reg_val = U16_MAX;
   746					else
   747						reg_val = (val * (1 << 16) +
   748							   mul_u64_u32_div(val2, 1 << 16,
   749									   MICRO)) / 2;
   750	
   751					return regmap_write(st->regmap16,
   752						AD4695_REG_GAIN_IN(chan->scan_index),
   753						reg_val);
   754				default:
   755					return -EINVAL;
   756				}
   757			case IIO_CHAN_INFO_CALIBBIAS:
   758				switch (chan->type) {
   759				case IIO_VOLTAGE:
   760					if (val2 >= 0 && val > S16_MAX / 4)
   761						reg_val = S16_MAX;
   762					else if ((val2 < 0 ? -val : val) < S16_MIN / 4)
   763						reg_val = S16_MIN;
   764					else if (val2 < 0)
   765						reg_val = clamp_t(int,
   766							-(val * 4 + -val2 * 4 / MICRO),
   767							S16_MIN, S16_MAX);
   768					else if (val < 0)
   769						reg_val = clamp_t(int,
   770							val * 4 - val2 * 4 / MICRO,
   771							S16_MIN, S16_MAX);
   772					else
   773						reg_val = clamp_t(int,
   774							val * 4 + val2 * 4 / MICRO,
   775							S16_MIN, S16_MAX);
   776	
   777					return regmap_write(st->regmap16,
   778						AD4695_REG_OFFSET_IN(chan->scan_index),
   779						reg_val);
   780				default:
   781					return -EINVAL;
   782				}
   783			default:
   784				return -EINVAL;
   785			}
   786		}
   787		unreachable();
   788	}
   789	

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

  reply	other threads:[~2024-08-21  4:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 15:58 [PATCH 0/4] iio: adc: ad4695: implement calibration support David Lechner
2024-08-20 15:58 ` [PATCH 1/4] iio: adc: ad4695: add 2nd regmap for 16-bit registers David Lechner
2024-08-20 15:58 ` [PATCH 2/4] iio: adc: ad4695: implement calibration support David Lechner
2024-08-21  4:21   ` kernel test robot [this message]
2024-08-26 10:57     ` Jonathan Cameron
2024-08-21 13:16   ` Jonathan Cameron
2024-08-21 16:12     ` David Lechner
2024-08-21 16:33       ` Jonathan Cameron
2024-08-20 15:58 ` [PATCH 3/4] doc: iio: ad4695: update for " David Lechner
2024-08-20 15:58 ` [PATCH 4/4] iio: ABI: document ad4695 new attributes David Lechner
2024-08-26 10:46 ` [PATCH 0/4] iio: adc: ad4695: implement calibration support Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202408211207.fmYTjQDK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=corbet@lwn.net \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nuno.sa@analog.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox