[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20070412203113.GA9353@arun.site>
Date: Fri, 13 Apr 2007 02:01:13 +0530
From: Milind Arun Choudhary <milindchoudhary@...il.com>
To: kernel-janitors@...ts.osdl.org, linux-ia64@...r.kernel.org,
discuss@...-64.org
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
tony.luck@...el.com, ak@...e.de
Subject: [KJ][PATCH 01/03]ROUND_UP|DOWN macro cleanup in arch/ia64,x86_64
Add ALIGN_DOWN and round_down macros to kernel.h
Signed-off-by: Milind Arun Choudhary <milindchoudhary@...il.com>
---
kernel.h | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 9ddf25c..f8648b2 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -34,11 +34,13 @@ extern const char linux_proc_banner[];
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+#define ALIGN_DOWN(x,a) ((x)&~((typeof(x))(a)-1))
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#define round_down(x, y) (((x) / (y)) * (y))
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
-#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
-#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#define KERN_EMERG "<0>" /* system is unusable */
#define KERN_ALERT "<1>" /* action must be taken immediately */
--
Milind Arun Choudhary
-
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