From: Arnd Bergmann <arnd@arndb.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Arnd Bergmann <arnd@arndb.de>, Tejun Heo <tj@kernel.org>,
Josef Bacik <jbacik@fb.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] block: iolatency: avoid 64-bit division
Date: Tue, 10 Jul 2018 17:21:34 +0200 [thread overview]
Message-ID: <20180710152146.2371336-1-arnd@arndb.de> (raw)
On 32-bit architectures, dividing a 64-bit number needs to use the
do_div() function or something like it to avoid a link failure:
block/blk-iolatency.o: In function `iolatency_prfill_limit':
blk-iolatency.c:(.text+0x8cc): undefined reference to `__aeabi_uldivmod'
Using div_u64() gives us the best output and avoids the need for an
explicit cast.
Fixes: d70675121546 ("block: introduce blk-iolatency io controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
block/blk-iolatency.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index a35a1f580337..56ddb2c68752 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -798,8 +798,7 @@ static u64 iolatency_prfill_limit(struct seq_file *sf,
if (!dname || !iolat->min_lat_nsec)
return 0;
seq_printf(sf, "%s target=%llu\n",
- dname,
- (unsigned long long)iolat->min_lat_nsec / NSEC_PER_USEC);
+ dname, div_u64(iolat->min_lat_nsec, NSEC_PER_USEC));
return 0;
}
--
2.9.0
next reply other threads:[~2018-07-10 15:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 15:21 Arnd Bergmann [this message]
2018-07-10 18:28 ` Jens Axboe
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=20180710152146.2371336-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=jbacik@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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®