[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1311664225-20172-1-git-send-email-nab@linux-iscsi.org>
Date: Tue, 26 Jul 2011 07:10:24 +0000
From: "Nicholas A. Bellinger" <nab@...ux-iscsi.org>
To: target-devel <target-devel@...r.kernel.org>,
linux-scsi <linux-scsi@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Cc: 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>,
Nicholas Bellinger <nab@...ux-iscsi.org>
Subject: [PATCH 1/2] kernel.h: Add DIV_ROUND_UP_ULL usage
From: Nicholas Bellinger <nab@...ux-iscsi.org>
Add new DIV_ROUND_UP_ULL macro usage for 32-bit architectures requiring
unsigned long long division of sectors * dev_max_sectors.
Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Nicholas A. Bellinger <nab@...ux-iscsi.org>
---
include/linux/kernel.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 953352a..016dcc9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -56,6 +56,8 @@
#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; })
/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
#define roundup(x, y) ( \
--
1.7.2.5
--
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