All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] use "is_power_of_2()" macro for simplicity.
Date: Wed, 07 Nov 2007 12:48:38 +0000	[thread overview]
Message-ID: <20071107124838.GL4113@parisc-linux.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0711070301540.8914@localhost.localdomain>

On Wed, Nov 07, 2007 at 03:03:39AM -0500, Robert P. J. Day wrote:
>  	 */
> -	if (size & (size - 1)) {
> +	if (!is_power_of_2(size)) {
>  		BUG_ON(size > 0x80000000);
>  		size = roundup_pow_of_two(size);
>  	}

Why not just delete the if?

	BUG_ON(size > 0x80000000);
	size = roundup_pow_of_two(size);

It's not a fast-path, and we'll consume a little less .text

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2007-11-07 12:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  8:03 [PATCH] use "is_power_of_2()" macro for simplicity Robert P. J. Day
2007-11-07 12:48 ` Matthew Wilcox [this message]
2007-11-08  6:55 ` Robert P. J. Day

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=20071107124838.GL4113@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.