lkml.org 
[lkml]   [2006]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/6] Implement a general log2 facility in the kernel
On Wed, Sep 13, 2006 at 02:03:00PM +0100, David Howells wrote:
> From: David Howells <dhowells@redhat.com>
>
> This facility provides three entry points:
>
> log2() Log base 2 of u32
> ll_log2() Log base 2 of u64
> long_log2() Log base 2 of unsigned long

The names are rather counter-intuitive. "ll" sounds like "long long", so
why does it opearte on *unsigned* 64-bit? Ditto for "long_log2()".
Perhaps they should be log2_u32(), log2_u64(), etc.

Even better if someone can come up with the right pre-processor magic
using sizeof/typeof so that you could just use "log2(any type)"


-Tony
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-13 18:03    [W:0.036 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site