mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "Joerg Roedel" <joerg.roedel@amd.com>,
	mingo@redhat.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH 0/5] x86 cleanup: convert round_up() to roundup()
Date: Mon, 28 Jul 2008 23:41:27 -0700	[thread overview]
Message-ID: <86802c440807282341g65c90f10gbdcf72beecdd0852@mail.gmail.com> (raw)
In-Reply-To: <20080726133932.GB4401@elte.hu>

On Sat, Jul 26, 2008 at 6:39 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Joerg Roedel <joerg.roedel@amd.com> wrote:
>
>> The x86 architecture declares its own round_up macro. But there is a
>> generic one in <linux/kernel.h> which can also be used. This patchset
>> replaces the x86 round_up() macro with the generic roundup() one where
>> possible. The patches have been compile-tested for 32 and 64 bit and
>> boot-tested for 64 bit. If we can fix the other places too we can get
>> rid of the x86 specific round_up() in the future.
>
> applied to tip/x86/cleanups - thanks Joerg!
>
these patches looks like some backward, aka wrong direction.

#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))

#define round_up(x, y) (((x) + (y) - 1) & ~((y) - 1))
#define round_down(x, y) ((x) & ~((y) - 1))

round_up looks more efficient.

YH

  reply	other threads:[~2008-07-29  6:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 14:48 Joerg Roedel
2008-07-25 14:48 ` [PATCH 1/5] x86: convert pci-dma.c from round_up to roundup Joerg Roedel
2008-07-25 14:48 ` [PATCH 2/5] x86: convert pageattr.c " Joerg Roedel
2008-07-25 14:48 ` [PATCH 3/5] x86: convert init_64.c " Joerg Roedel
2008-07-25 14:48 ` [PATCH 4/5] x86: convert numa_64.c " Joerg Roedel
2008-07-25 14:48 ` [PATCH 5/5] x86: convert discontig_32.c " Joerg Roedel
2008-07-26 13:39 ` [PATCH 0/5] x86 cleanup: convert round_up() to roundup() Ingo Molnar
2008-07-29  6:41   ` Yinghai Lu [this message]
2008-07-29  7:16     ` Ingo Molnar
2008-07-29  8:02     ` Joerg Roedel

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=86802c440807282341g65c90f10gbdcf72beecdd0852@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=hpa@zytor.com \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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®