Skip to contentSkip to conversation

iio: afe: rescale: Don't use ULL(1) << x instead of BIT(x)

PATCH In review Andy Shevchenko 3 participants 3 messages Nov 17 – Nov 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/iio/afe/iio-rescale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/afe/iio-rescale.c +1 -1
index b3cc610b48b8..25e179a3706b 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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.

---

This file could get IWYU'd as well at some point.

Signature · 2 lines
Kind regards,
Joshua Crofts
maintainer
#2 lore raw
Quoted 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.

---

This file could get IWYU'd as well at some point.

Applied with title tweaked to mention BIT_ULL(x)