From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
target-devel <target-devel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>, Andy Grover <agrover@redhat.com>,
Hannes Reinecke <hare@suse.de>,
Roland Dreier <roland@purestorage.com>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Boaz Harrosh <openosd@gmail.com>,
Mike Christie <michaelc@cs.wisc.edu>
Subject: Re: [GIT PULL] iscsi-target merge for v3.1-rc1
Date: Tue, 26 Jul 2011 00:26:01 -0700 [thread overview]
Message-ID: <1311665161.17766.234.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <CA+55aFyNBaf2+=XJDLKNF1S5zMtpx38+Zd8uNd9k4ap4YpZmvw@mail.gmail.com>
On Tue, 2011-07-26 at 00:09 -0700, Linus Torvalds wrote:
> On Mon, Jul 25, 2011 at 11:51 PM, Nicholas A. Bellinger
> <nab@linux-iscsi.org> wrote:
> >
> > How about the following to add a new DIV_ROUND_UP_ULL macro
>
> Hmm.
>
> > #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
> > +#define DIV_ROUND_UP_ULL(n,d) ( \
> > +{ \
> > + unsigned long long _tmp = n, _off; \
> > + int _res; \
> > + /* Round up using asm/div64.h:do_div */ \
> > + _off = do_div(_tmp, d); \
> > + if (_off != 0) \
> > + _tmp++; \
> > + _res = _tmp; \
> > +} \
> > +)
>
> That looks buggy. Why the "_res = _tmp" there? All that does is to
> truncate the result to "int", which looks bogus.
>
> And it just looks unnecessarily complicated. Just a simple
>
> #define DIV_ROUND_UP_ULL(ll,d) \
> ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
>
> looks like it would work and be simpler. Avoid the conditional, do the
> same "add 'd-1' thing as the regular ROUND_UP().
>
> Untested. And not much thinking involved.
>
Fixing this up in lio-core-2.6.git now and pushing out into
target-pending.git/for-next now unless you have any other concerns.
Thank you,
--nab
next prev parent reply other threads:[~2011-07-26 7:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-23 23:16 Nicholas A. Bellinger
2011-07-23 23:33 ` Andrew Morton
2011-07-24 0:19 ` Nicholas A. Bellinger
2011-07-24 2:27 ` Stephen Rothwell
2011-07-25 23:37 ` Andrew Morton
2011-07-25 23:46 ` Linus Torvalds
2011-07-25 23:52 ` Andrew Morton
2011-07-25 23:50 ` Andrew Morton
2011-07-26 6:51 ` Nicholas A. Bellinger
2011-07-26 7:09 ` Linus Torvalds
2011-07-26 7:26 ` Nicholas A. Bellinger [this message]
2011-07-26 7:43 ` Andrew Morton
2011-07-26 7:51 ` Nicholas A. Bellinger
2011-07-26 10:08 ` Olivier Galibert
2011-07-26 10:14 ` Alexey Dobriyan
2011-07-26 0:32 ` Nicholas A. Bellinger
2011-07-26 1:09 ` Andy Grover
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=1311665161.17766.234.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=agrover@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=openosd@gmail.com \
--cc=roland@purestorage.com \
--cc=target-devel@vger.kernel.org \
--cc=torvalds@linux-foundation.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®