iio: afe: rescale: Don't use ULL(1) << x instead of BIT(x)
Subsystems (2)
PATCH 1/1 iio: afe: rescale: Don't use ULL(1) << x instead of BIT(x)
ULL(1) << x is just an open-coded implementation of BIT_ULL(). Replace the former by the latter.
Note, the rest of the code properly uses BIT()/BIT_ULL() already.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/iio/afe/iio-rescale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/afe/iio-rescale.c +1 -1
@@ -67,7 +67,7 @@ int rescale_process_scale(struct rescale *rescale, int scale_type,if (scale_type ==IIO_VAL_FRACTIONAL ) tmp = *val2;else - tmp =ULL (1 ) << *val2; + tmp =BIT_ULL (*val2); rem2 = *val % (int )tmp; *val = *val / (int )tmp;
Signature · 1 line
2.50.1
Quoted 7 lines · On Tue, 17 Nov 2026 11:12:16 +0100 Andy Shevchenko…
ULL(1) << x is just an open-coded implementation of
BIT_ULL(). Replace the former by the latter.Note, the rest of the code properly uses BIT()/BIT_ULL() already.
Signed-off-by Andy Shevchenko <[email protected]>---
This file could get IWYU'd as well at some point.
Reviewed-by Joshua Crofts <[email protected]>
Signature · 2 lines
Kind regards, Joshua Crofts
Jonathan Cameron
maintainerQuoted 6 lines · On Wed, 18 Nov 2026 09:28:12 +0100 Joshua Crofts <[email protected]> wrote:
Quoted 3 lines · On Tue, 17 Nov 2026 11:12:16 +0100 Andy Shevchenko…
ULL(1) << x is just an open-coded implementation of
BIT_ULL(). Replace the former by the latter.
Quoted 9 lines
Quoted 4 lines
Note, the rest of the code properly uses BIT()/BIT_ULL() already.
Signed-off-by Andy Shevchenko <[email protected]>---
This file could get IWYU'd as well at some point.
Reviewed-by Joshua Crofts <[email protected]>
Applied with title tweaked to mention BIT_ULL(x)