mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] remove BITS_TO_TYPE macro
Date: Sun, 26 Aug 2007 11:54:58 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0708261143470.4267@localhost.localdomain> (raw)
In-Reply-To: <880710657292153543@pripojeni.net>

On Sun, 26 Aug 2007, Jiri Slaby wrote:

> remove BITS_TO_TYPE macro
>
> I realized, that it is actually the same as DIV_ROUND_UP, use it instead.

unless there are some patches in the queue, the whole area of rounding
up and aligning is still sort of messy.

kernel.h defines the following:

...
#define ALIGN(x,a)              __ALIGN_MASK(x,(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask)    (((x)+(mask))&~(mask))
...
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
...

yet there is no corresponding DIV_ROUND_DOWN() or rounddown(), just
for the sake of consistency. (maybe there's simply no need?)

would someone like to propose a single, consistent standard for those
things?  or is it not worth it?

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

      reply	other threads:[~2007-08-26 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-26 14:08 Jiri Slaby
2007-08-26 15:54 ` Robert P. J. Day [this message]

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=Pine.LNX.4.64.0708261143470.4267@localhost.localdomain \
    --to=rpjday@mindspring.com \
    --cc=akpm@linux-foundation.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®