[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1311669306.17766.256.camel@haakon2.linux-iscsi.org>
Date: Tue, 26 Jul 2011 01:35:06 -0700
From: "Nicholas A. Bellinger" <nab@...ux-iscsi.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-scsi <linux-scsi@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>,
Andy Grover <agrover@...hat.com>,
Hannes Reinecke <hare@...e.de>,
Roland Dreier <roland@...estorage.com>,
James Bottomley <James.Bottomley@...senPartnership.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
target-devel <target-devel@...r.kernel.org>
Subject: Re: [PATCH-v2 1/2] kernel.h: Add DIV_ROUND_UP_ULL and
DIV_ROUND_UP_SECTOR_T macro usage
On Tue, 2011-07-26 at 07:35 +0000, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@...ux-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@...ux-foundation.org>
> Reported-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Nicholas A. Bellinger <nab@...ux-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists