Skip to content

Commit b24e88b

Browse files
committed
platform: cznic: use ffs() instead of __bf_shf()
__bf_shf() on a 64-bit variable causes a link failure during compile-testing: drivers-platform-cznic-turris-omnia-mcu-gpio.c:(.text):undefined-reference-to-__ffsdi2 Open-code this using ffs()-1, which has the same result but avoids the library call. Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 6429892 commit b24e88b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/cznic/turris-omnia-mcu-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ int omnia_mcu_request_irq(struct omnia_mcu *mcu, u32 spec,
11041104
if (!spec)
11051105
return -EINVAL;
11061106

1107-
irq_idx = omnia_int_to_gpio_idx[__bf_shf(spec)];
1107+
irq_idx = omnia_int_to_gpio_idx[ffs(spec) - 1];
11081108
irq = gpiod_to_irq(gpio_device_get_desc(mcu->gc.gpiodev, irq_idx));
11091109
if (irq < 0)
11101110
return irq;

0 commit comments

Comments
 (0)