From: Arnd Bergmann <arnd@kernel.org>
To: "Marek Behún" <kabel@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] platform: turris: use ffs() instead of __bf_shf()
Date: Fri, 4 Apr 2025 15:55:26 +0200 [thread overview]
Message-ID: <20250404135531.2421755-2-arnd@kernel.org> (raw)
In-Reply-To: <20250404135531.2421755-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
__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 <arnd@arndb.de>
---
drivers/platform/cznic/turris-omnia-mcu-gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/cznic/turris-omnia-mcu-gpio.c b/drivers/platform/cznic/turris-omnia-mcu-gpio.c
index 932383f7491a..c2df24ea8686 100644
--- a/drivers/platform/cznic/turris-omnia-mcu-gpio.c
+++ b/drivers/platform/cznic/turris-omnia-mcu-gpio.c
@@ -1104,7 +1104,7 @@ int omnia_mcu_request_irq(struct omnia_mcu *mcu, u32 spec,
if (!spec)
return -EINVAL;
- irq_idx = omnia_int_to_gpio_idx[__bf_shf(spec)];
+ irq_idx = omnia_int_to_gpio_idx[ffs(spec) - 1];
irq = gpiod_to_irq(gpio_device_get_desc(mcu->gc.gpiodev, irq_idx));
if (irq < 0)
return irq;
--
2.39.5
next prev parent reply other threads:[~2025-04-04 13:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 13:55 [PATCH 1/2] firmware: turris-mox-rwtm: fix building without CONFIG_KEYS Arnd Bergmann
2025-04-04 13:55 ` Arnd Bergmann [this message]
2025-04-06 20:12 ` [PATCH 2/2] platform: turris: use ffs() instead of __bf_shf() Marek Behún
2025-04-06 20:13 ` [PATCH 1/2] firmware: turris-mox-rwtm: fix building without CONFIG_KEYS Marek Behún
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250404135531.2421755-2-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=bartosz.golaszewski@linaro.org \
--cc=kabel@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®