All of lore.kernel.org
 help / color / mirror / Atom feed
From: vignesh babu <vignesh.babu@wipro.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] Re: rounddown_pow_of_2 inclusion into log2.h
Date: Tue, 14 Aug 2007 10:17:59 +0000	[thread overview]
Message-ID: <1187085959.3874.23.camel@merlin.linuxcoe.com> (raw)

13 that i can identify as of now :)

On Tue, 2007-08-14 at 05:48 -0400, Robert P. J. Day wrote:
> On Tue, 14 Aug 2007, vignesh babu wrote:
> 
> >
> > rday,
> >
> >   Any plans on including what Andrew Morton suggested in the near
> > future? Think you have had enough time to convince yourself ;)
> 
>   if there's value in it, the following seems to work fine in terms of
> rounding down to the nearest power of two.
> 
> static inline unsigned long
> rounddown_pow_of_two(unsigned long n)
> {
> 	return (n = 1) ? 0 : (1UL << ilog2(n));
> }
> 
>   args that are already a power of two will be unchanged, 1 will
> clearly return 0, but an arg of zero should also be caught since
> that's undefined -- perhaps it should also return zero?
> 
>   in any event, that routine seems to work fine.  are there enough
> places in the source tree to make this cleanup worth it?
> 
> rday
-- 
Vignesh Babu BM 
_____________________________________________________________ 
"Why is it that every time I'm with you, makes me believe in magic?"

_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

                 reply	other threads:[~2007-08-14 10:17 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=1187085959.3874.23.camel@merlin.linuxcoe.com \
    --to=vignesh.babu@wipro.com \
    --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.