From: Jonathan Cameron Date: Sun, 16 May 2021 17:25:13 +0000 (+0100) Subject: iio: adc: max11100: Use get_unaligned_be16() rather than opencoding. X-Git-Tag: v5.14-rc1~66^2~180^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff9111ab3e1f01cad2318c6bc989c8bf51a570ac;p=thirdparty%2Flinux.git iio: adc: max11100: Use get_unaligned_be16() rather than opencoding. The function is more explicit in showing the intent + quicker on some platforms. Signed-off-by: Jonathan Cameron Cc: Jacopo Mondi Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20210516172520.1398835-2-jic23@kernel.org --- diff --git a/drivers/iio/adc/max11100.c b/drivers/iio/adc/max11100.c index 6cf21758ca66c..69d607fa17aa9 100644 --- a/drivers/iio/adc/max11100.c +++ b/drivers/iio/adc/max11100.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -63,7 +64,7 @@ static int max11100_read_single(struct iio_dev *indio_dev, int *val) return -EINVAL; } - *val = (state->buffer[1] << 8) | state->buffer[2]; + *val = get_unaligned_be16(&state->buffer[1]); return 0; }