From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751592Ab1GZHeH (ORCPT ); Tue, 26 Jul 2011 03:34:07 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:43697 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751087Ab1GZHeA (ORCPT ); Tue, 26 Jul 2011 03:34:00 -0400 From: "Nicholas A. Bellinger" To: target-devel , linux-scsi , linux-kernel Cc: Christoph Hellwig , Andy Grover , Hannes Reinecke , Roland Dreier , James Bottomley , Andrew Morton , Linus Torvalds , Nicholas Bellinger Subject: [PATCH 1/2] kernel.h: Add DIV_ROUND_UP_ULL usage Date: Tue, 26 Jul 2011 07:10:24 +0000 Message-Id: <1311664225-20172-1-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.7.2.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Bellinger 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 Signed-off-by: Nicholas A. Bellinger --- 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