[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <617E1C2C70743745A92448908E030B2A015B4E12@scsmsx411.amr.corp.intel.com>
Date: Fri, 13 Apr 2007 09:45:49 -0700
From: "Luck, Tony" <tony.luck@...el.com>
To: "Milind Arun Choudhary" <milindchoudhary@...il.com>
Cc: <kernel-janitors@...ts.osdl.org>, <linux-ia64@...r.kernel.org>,
<discuss@...-64.org>, <linux-kernel@...r.kernel.org>,
<akpm@...ux-foundation.org>, <ak@...e.de>
Subject: RE: [KJ][PATCH 02/03]ROUND_UP|DOWN macro cleanup in arch/ia64,x86_64
> So as ALIGN macro does the same work as ROUNDUP,
Although it is mathematically the same operation, the
semantic associations of the name are important too.
If I have an I/O device that works in blocks of a given
size, I don't think that I'm "aligning" a request to make
it match the capabilities of the device, I think that I'm
"rounding up" to a multiple of the size.
Maybe this is because I started out in mathematics before
discovering that computers were so much fun, or maybe it
is a British-English bias ... I can't tell, but it makes
sense to me to use ROUNDUP in some places, and ALIGN in
others.
I haven't scanned through all usages to see whether existing
usage matches my bias ... but changing them all to use just
one name doesn't feel like the right thing to do. It makes
some code less clear (to me).
> is at a common place
> & is accessible to everyone
If ROUNDUP isn't available everywhere, then it should be. To
avoid code duplication perhaps we should add:
#define ROUNDUP(size, len) ALIGN((size), (len))
and delete the previous ROUNDUP definition?
-Tony
-
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