public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Milind Arun Choudhary <milindchoudhary@gmail.com>
To: kernel-janitors@lists.osdl.org, linux-ia64@vger.kernel.org,
	discuss@x86-64.org
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	tony.luck@intel.com, ak@suse.de
Subject: [KJ][PATCH 01/03]ROUND_UP|DOWN macro cleanup in arch/ia64,x86_64
Date: Thu, 12 Apr 2007 20:43:13 +0000	[thread overview]
Message-ID: <20070412203113.GA9353@arun.site> (raw)

Add ALIGN_DOWN and round_down macros to kernel.h

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.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

                 reply	other threads:[~2007-04-12 20:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070412203113.GA9353@arun.site \
    --to=milindchoudhary@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=discuss@x86-64.org \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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