From: Jonathan Cameron <jic23@kernel.org>
To: Abhash Jha <abhashkumarjha123@gmail.com>
Cc: linux-iio@vger.kernel.org, lars@metafoo.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: max1363: Convert to get_unaligned_be16
Date: Sat, 28 Sep 2024 16:30:46 +0100 [thread overview]
Message-ID: <20240928163046.2abc6943@jic23-huawei> (raw)
In-Reply-To: <20240920181437.20194-1-abhashkumarjha123@gmail.com>
On Fri, 20 Sep 2024 23:44:37 +0530
Abhash Jha <abhashkumarjha123@gmail.com> wrote:
> Converted manual shifting and or to use `get_unaligned_be16` api
> instead.
>
> Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Applied
Thanks,
Jonathan
> ---
> drivers/iio/adc/max1363.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
> index bf4b6dc53..0801317da 100644
> --- a/drivers/iio/adc/max1363.c
> +++ b/drivers/iio/adc/max1363.c
> @@ -33,6 +33,8 @@
> #include <linux/iio/trigger_consumer.h>
> #include <linux/iio/triggered_buffer.h>
>
> +#include <asm/unaligned.h>
> +
> #define MAX1363_SETUP_BYTE(a) ((a) | 0x80)
>
> /* There is a fair bit more defined here than currently
> @@ -391,7 +393,7 @@ static int max1363_read_single_chan(struct iio_dev *indio_dev,
> if (data < 0)
> return data;
>
> - data = (rxbuf[1] | rxbuf[0] << 8) &
> + data = get_unaligned_be16(rxbuf) &
> ((1 << st->chip_info->bits) - 1);
> } else {
> /* Get reading */
prev parent reply other threads:[~2024-09-28 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 18:14 [PATCH] iio: adc: max1363: Convert to get_unaligned_be16 Abhash Jha
2024-09-28 15:30 ` 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=20240928163046.2abc6943@jic23-huawei \
--to=jic23@kernel.org \
--cc=abhashkumarjha123@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.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