From: Mike Snitzer <snitzer@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: dm-devel@redhat.com, Neil Brown <neilb@suse.com>,
linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
Alasdair Kergon <agk@redhat.com>,
Sami Tolvanen <samitolvanen@google.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: dm verity: use sector_div for division
Date: Tue, 8 Dec 2015 12:10:13 -0500 [thread overview]
Message-ID: <20151208171013.GA4263@redhat.com> (raw)
In-Reply-To: <2666833.eM84rj4CYY@wuerfel>
On Tue, Dec 08 2015 at 10:42am -0500,
Arnd Bergmann <arnd@arndb.de> wrote:
> The dm verity sec implementation uses do_div for dividing a sector_t,
> which is slower than necessary when sector_t is a 32-bit type, and
> we now get a warning for this case:
>
> include/asm-generic/div64.h:224:22: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]
> drivers/md/dm-verity-fec.c:725:6: note: in expansion of macro 'do_div'
> if (do_div(f->rounds, f->rsn))
>
> This changes the code to use sector_div instead, which does the
> right thing and avoids the warning.
Thanks, I'll fold this in.
(Btw, I did review this use of do_div(): but only to answer whether there
was potential for a 64bit divide. I concluded do_div() was fine but didn't
look to see the data type for f->rounds was actually sector_t.)
prev parent reply other threads:[~2015-12-08 17:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 15:42 [PATCH] dm verity: use sector_div for division Arnd Bergmann
2015-12-08 17:10 ` Mike Snitzer [this message]
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=20151208171013.GA4263@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=arnd@arndb.de \
--cc=dm-devel@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
--cc=samitolvanen@google.com \
/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;
as well as URLs for NNTP newsgroup(s).