public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: oe-kbuild@lists.linux.dev,
	Ramona Gradinariu <ramona.bolboaca13@gmail.com>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, conor+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, robh@kernel.org,
	nuno.sa@analog.com, lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v5 9/9] drivers: iio: imu: Add support for adis1657x family
Date: Sun, 2 Jun 2024 12:10:51 +0100	[thread overview]
Message-ID: <20240602121051.2f322667@jic23-huawei> (raw)
In-Reply-To: <ff870fa7-436c-4ab1-9e8b-a5efcdd28c29@moroto.mountain>

On Wed, 29 May 2024 17:32:40 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> Hi Ramona,
> 
> kernel test robot noticed the following build warnings:
> 
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Ramona-Gradinariu/dt-bindings-iio-imu-Add-ADIS16501-compatibles/20240527-230203
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
> patch link:    https://lore.kernel.org/r/20240527142618.275897-10-ramona.bolboaca13%40gmail.com
> patch subject: [PATCH v5 9/9] drivers: iio: imu: Add support for adis1657x family
> config: x86_64-randconfig-161-20240528 (https://download.01.org/0day-ci/archive/20240528/202405281539.EXGy0dhk-lkp@intel.com/config)
> compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
> 
> 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>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202405281539.EXGy0dhk-lkp@intel.com/
> 
> smatch warnings:
> drivers/iio/imu/adis16475.c:1608 adis16475_push_single_sample() warn: missing error code? 'ret'
> 
> vim +/ret +1608 drivers/iio/imu/adis16475.c
> 
> c49e2871e50119 Ramona Gradinariu 2024-05-27  1577  static int adis16475_push_single_sample(struct iio_poll_func *pf)
> fff7352bf7a3ce Nuno Sá           2020-04-13  1578  {
> fff7352bf7a3ce Nuno Sá           2020-04-13  1579  	struct iio_dev *indio_dev = pf->indio_dev;
> fff7352bf7a3ce Nuno Sá           2020-04-13  1580  	struct adis16475 *st = iio_priv(indio_dev);
> fff7352bf7a3ce Nuno Sá           2020-04-13  1581  	struct adis *adis = &st->adis;
> 8f6bc87d67c030 Ramona Bolboaca   2023-08-08  1582  	int ret, bit, buff_offset = 0, i = 0;
> fff7352bf7a3ce Nuno Sá           2020-04-13  1583  	__be16 *buffer;
> fff7352bf7a3ce Nuno Sá           2020-04-13  1584  	u16 crc;
> fff7352bf7a3ce Nuno Sá           2020-04-13  1585  	bool valid;
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1586  	u8 crc_offset = 9;
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1587  	u16 burst_size = ADIS16475_BURST_MAX_DATA;
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1588  	u16 start_idx = (st->info->flags & ADIS16475_HAS_TIMESTAMP32) ? 2 : 0;
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1589  
> fff7352bf7a3ce Nuno Sá           2020-04-13  1590  	/* offset until the first element after gyro and accel */
> fff7352bf7a3ce Nuno Sá           2020-04-13  1591  	const u8 offset = st->burst32 ? 13 : 7;
> fff7352bf7a3ce Nuno Sá           2020-04-13  1592  
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1593  	if (st->burst32) {
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1594  		crc_offset = (st->info->flags & ADIS16475_HAS_TIMESTAMP32) ? 16 : 15;
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1595  		burst_size = adis->data->burst_max_len;
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1596  	}
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1597  
> fff7352bf7a3ce Nuno Sá           2020-04-13  1598  	ret = spi_sync(adis->spi, &adis->msg);
> fff7352bf7a3ce Nuno Sá           2020-04-13  1599  	if (ret)
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1600  		return ret;
> fff7352bf7a3ce Nuno Sá           2020-04-13  1601  
> fff7352bf7a3ce Nuno Sá           2020-04-13  1602  	buffer = adis->buffer;
> fff7352bf7a3ce Nuno Sá           2020-04-13  1603  
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1604  	crc = be16_to_cpu(buffer[crc_offset]);
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27  1605  	valid = adis16475_validate_crc(adis->buffer, crc, burst_size, start_idx);
> fff7352bf7a3ce Nuno Sá           2020-04-13  1606  	if (!valid) {
> fff7352bf7a3ce Nuno Sá           2020-04-13  1607  		dev_err(&adis->spi->dev, "Invalid crc\n");
> 7f174ee4adeb12 Ramona Gradinariu 2024-05-27 @1608  		return ret;
>                                                                 ^^^^^^^^^^
> return -EINVAL
I've gone with this as the fix whilst applying the patch

Thanks,

Jonathan

> 
> fff7352bf7a3ce Nuno Sá           2020-04-13  1609  	}
> fff7352bf7a3ce Nuno Sá           2020-04-13  1610  
> fff7352bf7a3ce Nuno Sá           2020-04-13  1611  	for_each_set_bit(bit, indio_dev->active_scan_mask,
> fff7352bf7a3ce Nuno Sá           2020-04-13  1612  			 indio_dev->masklength) {
> fff7352bf7a3ce Nuno Sá           2020-04-13  1613  		/*
> fff7352bf7a3ce Nuno Sá           2020-04-13  1614  		 * When burst mode is used, system flags is the first data
> fff7352bf7a3ce Nuno Sá           2020-04-13  1615  		 * channel in the sequence, but the scan index is 7.
> fff7352bf7a3ce Nuno Sá           2020-04-13  1616  		 */
> 


  reply	other threads:[~2024-06-02 11:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 14:26 [PATCH v5 0/9] adis16501 and adis1657x support Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 1/9] dt-bindings: iio: imu: Add ADIS16501 compatibles Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 2/9] drivers: iio: imu: Add support for ADIS16501 Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 3/9] iio: imu: adis_buffer: Add buffer setup API with buffer attributes Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 4/9] iio: imu: adis16475: Create push single sample API Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 5/9] drivers: iio: imu: adis16475: generic computation for sample rate Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 6/9] iio: imu: adis_trigger: Allow level interrupts for FIFO readings Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 7/9] iio: imu: adis16475: Re-define ADIS16475_DATA Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 8/9] dt-bindings: iio: imu: Add ADIS1657X family devices compatibles Ramona Gradinariu
2024-05-27 14:26 ` [PATCH v5 9/9] drivers: iio: imu: Add support for adis1657x family Ramona Gradinariu
2024-05-29 14:32   ` Dan Carpenter
2024-06-02 11:10     ` Jonathan Cameron [this message]
2024-06-02 11:09 ` [PATCH v5 0/9] adis16501 and adis1657x 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=20240602121051.2f322667@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=nuno.sa@analog.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=ramona.bolboaca13@gmail.com \
    --cc=robh@kernel.org \
    /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