Re: [PATCH v1 10/16] iio: light: zopt2201: Use get_unaligned_le24()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 21 Apr 2020 03:31:29 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> This makes the driver code slightly easier to read.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Applied with asm/unaligned.h include added.

J
> ---
>  drivers/iio/light/zopt2201.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/zopt2201.c b/drivers/iio/light/zopt2201.c
> index 5f54f39e7a4c..0df45b42c091 100644
> --- a/drivers/iio/light/zopt2201.c
> +++ b/drivers/iio/light/zopt2201.c
> @@ -219,7 +219,7 @@ static int zopt2201_read(struct zopt2201_data *data, u8 reg)
>  		goto fail;
>  	mutex_unlock(&data->lock);
>  
> -	return (buf[2] << 16) | (buf[1] << 8) | buf[0];
> +	return get_unaligned_le24(&buf[0]);
>  
>  fail:
>  	mutex_unlock(&data->lock);




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux