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] [day] [month] [year] [list]
Message-ID: <20240929174845.5bac3f62@jic23-huawei>
Date: Sun, 29 Sep 2024 17:48:45 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Abhash Jha <abhashkumarjha123@...il.com>
Cc: linux-iio@...r.kernel.org, angelogioacchino.delregno@...labora.com,
 matthias.bgg@...il.com, lars@...afoo.de, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
 Gene Chen <gene_chen@...htek.com>
Subject: Re: [PATCH] iio: adc: mt6360-adc: Converted to use
 get_unaligned_be16()

On Sat, 28 Sep 2024 21:41:08 +0530
Abhash Jha <abhashkumarjha123@...il.com> wrote:

> Changed the manual shifting and adding of bytes to use
> get_unaligned_be16() api instead.
> 
> Signed-off-by: Abhash Jha <abhashkumarjha123@...il.com>
Looks simple so I've applied it, but plenty of time for
additional reviews to come in.

Jonathan

> ---
>  drivers/iio/adc/mt6360-adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
> index 3710473e5..91befe2cd 100644
> --- a/drivers/iio/adc/mt6360-adc.c
> +++ b/drivers/iio/adc/mt6360-adc.c
> @@ -124,7 +124,7 @@ static int mt6360_adc_read_channel(struct mt6360_adc_data *mad, int channel, int
>  		usleep_range(ADC_LOOP_TIME_US / 2, ADC_LOOP_TIME_US);
>  	}
>  
> -	*val = rpt[1] << 8 | rpt[2];
> +	*val = get_unaligned_be16(&rpt[1]);
>  	ret = IIO_VAL_INT;
>  
>  out_adc_conv:


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ