]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ad_sigma_delta: use BITS_TO_BYTES() macro
authorDavid Lechner <dlechner@baylibre.com>
Tue, 1 Jul 2025 21:37:53 +0000 (16:37 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Jul 2025 14:36:25 +0000 (15:36 +0100)
commite916934b591585140a59ac899ac356cd4a1f269f
tree163039a318be0068a136139736946a637dbdd3d9
parent1a913da6cfda0139bfe1fe203858d5ba30ac853d
iio: adc: ad_sigma_delta: use BITS_TO_BYTES() macro

Use the BITS_TO_BYTES() macro instead of dividing by 8 to convert bits
to bytes.

This makes it more obvious what unit conversion is taking place.

In one instance, we also avoid the temporary assignment to a variable
as it was confusing that reg_size was being used with two different
units (bits and bytes).

scan_type is factored out to reduce line wrapping.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250701-iio-adc-ad7173-add-spi-offload-support-v3-5-42abb83e3dac@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad_sigma_delta.c