mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <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>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	target-devel <target-devel@vger.kernel.org>
Subject: Re: [PATCH-v2 1/2] kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage
Date: Tue, 26 Jul 2011 01:35:06 -0700	[thread overview]
Message-ID: <1311669306.17766.256.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <1311665743-20639-1-git-send-email-nab@linux-iscsi.org>

On Tue, 2011-07-26 at 07:35 +0000, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
> 
> Add new DIV_ROUND_UP_SECTOR_T macro usage for 32-bit architectures requiring
> a new DIV_ROUND_UP_ULL, and existing 64-bit usage with DIV_ROUND_UP.
> 
> Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
> Reported-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
> ---
>  include/linux/kernel.h |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 953352a..e81b647 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -56,6 +56,14 @@
>  
>  #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
>  #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
> +#define DIV_ROUND_UP_ULL(ll,d) \
> +	({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
> +
> +#if BITS_PER_LONG == 32
> +# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
> +#else
> +# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
> +#endif
>  

Hi Andrew,

Is CONFIG_LBDAF=n usage going to have problems with the above..?  

Things are looking as expected AFAICT with some quick tests with
CONFIG_LBDAF=y on i386, but still need to verify the CONFIG_LBDAF=n on
32-bit as well.  Any more comments here are appercitated.

Thank you,

--nab




      parent reply	other threads:[~2011-07-26  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  7:35 Nicholas A. Bellinger
2011-07-26  7:35 ` [PATCH-v2 2/2] target: Convert to DIV_ROUND_UP_SECTOR_T usage for sectors / dev_max_sectors Nicholas A. Bellinger
2011-07-26  8:35 ` Nicholas A. Bellinger [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=1311669306.17766.256.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=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®