From: Arnd Bergmann <arnd@arndb.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Marcus Wolf <linux@Wolf-Entwicklungen.de>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: pi433: use div_u64 for 64-bit division
Date: Fri, 28 Jul 2017 15:23:12 +0200 [thread overview]
Message-ID: <20170728132339.332897-1-arnd@arndb.de> (raw)
I ran into this link error on an ARM OABI build:
drivers/staging/pi433/rf69.o: In function `rf69_set_frequency':
rf69.c:(.text+0xc9c): undefined reference to `__udivdi3'
No idea why I didn't see it with the default EABI configurations,
but the right solution here seems to be to use div_u64()
to get the external division implementation.
Fixes: 874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/staging/pi433/rf69.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index e391ce777bc7..e5267b5638c0 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -238,7 +238,7 @@ int rf69_set_frequency(struct spi_device *spi, u32 frequency)
do_div(f_step, 524288); // 524288 = 2^19
// check input value
- f_max = f_step * 8388608 / factor;
+ f_max = div_u64(f_step * 8388608, factor);
if (frequency > f_max)
{
dev_dbg(&spi->dev, "setFrequency: illegal input param");
--
2.9.0
next reply other threads:[~2017-07-28 13:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 13:23 Arnd Bergmann [this message]
2017-07-28 14:21 ` Marcus Wolf
2017-07-28 14:26 ` Dan Carpenter
2017-07-28 14:50 ` Marcus Wolf
2017-07-28 15:16 ` Send a large patch right now or is it better to do it later? Marcus Wolf
2017-07-29 7:23 ` Dan Carpenter
2017-08-28 15:17 ` Greg Kroah-Hartman
2017-07-28 14:26 ` [PATCH] staging: pi433: use div_u64 for 64-bit division Arnd Bergmann
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=20170728132339.332897-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@Wolf-Entwicklungen.de \
/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®