linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: axboe@kernel.dk (Jens Axboe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] null_blk: use sector_div instead of do_div
Date: Wed, 13 Jan 2016 15:11:07 -0700	[thread overview]
Message-ID: <5696CB7B.6040107@kernel.dk> (raw)
In-Reply-To: <11387794.RmibjdD6Rx@wuerfel>

On 01/13/2016 03:04 PM, Arnd Bergmann wrote:
> Dividing a sector_t number should be done using sector_div rather than do_div
> to optimize the 32-bit sector_t case, and with the latest do_div optimizations,
> we now get a compile-time warning for this:
>
> arch/arm/include/asm/div64.h:32:95: note: expected 'uint64_t * {aka long long unsigned int *}' but argument is of type 'sector_t * {aka long unsigned int *}'
> drivers/block/null_blk.c:521:81: warning: comparison of distinct pointer types lacks a cast
>
> This changes the newly added code to use sector_div. It is a simplified version
> of the original patch, as Linus Torvalds pointed out that we should not be using
> an expensive division function in the first place.
>
> This version was suggested by Matias Bjorling.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Matias Bjorling <m@bjorling.me>
> Fixes: b2b7e00148a2 ("null_blk: register as a LightNVM device")
> ---
> [resent to Jens' correct address, sorry about the duplicates]

Thanks Arnd, added.

-- 
Jens Axboe

  reply	other threads:[~2016-01-13 22:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 22:04 [PATCH v2] null_blk: use sector_div instead of do_div Arnd Bergmann
2016-01-13 22:11 ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-13 21:49 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=5696CB7B.6040107@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).