Linux-IIO Archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Ramona Gradinariu <ramona.gradinariu@analog.com>
Cc: <linux-kernel@vger.kernel.org>, <nuno.sa@analog.com>,
	<linux-iio@vger.kernel.org>
Subject: Re: [PATCH 1/1] iio:imu: adis16475: Fix sync mode setting
Date: Sat, 6 Apr 2024 16:39:28 +0100	[thread overview]
Message-ID: <20240406163928.1ea36f04@jic23-huawei> (raw)
In-Reply-To: <20240403111357.1074511-2-ramona.gradinariu@analog.com>

On Wed, 3 Apr 2024 14:13:57 +0300
Ramona Gradinariu <ramona.gradinariu@analog.com> wrote:

> Fix sync mode setting by applying the necessary shift bits.
> 
> Fixes: fff7352bf7a3 ("iio: imu: Add support for adis16475")
> Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
> ---
>  drivers/iio/imu/adis16475.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
> index 01f55cc902fa..bd30c3469d9a 100644
> --- a/drivers/iio/imu/adis16475.c
> +++ b/drivers/iio/imu/adis16475.c
> @@ -1351,7 +1351,8 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
>  	 * in chip_info.
>  	 */
>  	ret = __adis_update_bits(&st->adis, ADIS16475_REG_MSG_CTRL,
> -				 ADIS16475_SYNC_MODE_MASK, sync->sync_mode);
> +				 ADIS16475_SYNC_MODE_MASK,
> +				 ADIS16475_SYNC_MODE(sync->sync_mode));
As per the build bots, this is triggering a check on the size the last variable.
See definition of adis_update_bits()
There is even a comment in there to 'beware' of what you hit here.

Easiest is probably to force that with 
 (u16)ADIS16475_SYNC_MODE(sync->sync_mode));
or a local variable.


>  	if (ret)
>  		return ret;
>  


      parent reply	other threads:[~2024-04-06 15:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 11:13 [PATCH 0/1] iio:imu: adis16475: Fix sync mode setting Ramona Gradinariu
2024-04-03 11:13 ` [PATCH 1/1] " Ramona Gradinariu
2024-04-03 13:36   ` Nuno Sá
2024-04-04 12:35   ` kernel test robot
2024-04-04 13:07   ` kernel test robot
2024-04-06 15:39   ` Jonathan Cameron [this message]

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=20240406163928.1ea36f04@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=ramona.gradinariu@analog.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).