lkml.org 
[lkml]   [2005]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 5/6] lib/bitmap.c: use generic round_up_pow2() macro
From: Nick Wilson <njw@osdl.org>

Use the generic round_up_pow2() instead of a custom rounding method.

Signed-off-by: Nick Wilson <njw@osdl.org>
---


bitmap.c | 3 +--
1 files changed, 1 insertion(+), 2 deletions(-)

Index: linux/lib/bitmap.c
===================================================================
--- linux.orig/lib/bitmap.c 2005-04-07 15:13:56.000000000 -0700
+++ linux/lib/bitmap.c 2005-04-07 15:46:15.000000000 -0700
@@ -289,7 +289,6 @@ EXPORT_SYMBOL(__bitmap_weight);

#define CHUNKSZ 32
#define nbits_to_hold_value(val) fls(val)
-#define roundup_power2(val,modulus) (((val) + (modulus) - 1) & ~((modulus) - 1))
#define unhex(c) (isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10))
#define BASEDEC 10 /* fancier cpuset lists input in decimal */

@@ -316,7 +315,7 @@ int bitmap_scnprintf(char *buf, unsigned
if (chunksz == 0)
chunksz = CHUNKSZ;

- i = roundup_power2(nmaskbits, CHUNKSZ) - CHUNKSZ;
+ i = round_up_pow2(nmaskbits, CHUNKSZ) - CHUNKSZ;
for (; i >= 0; i -= CHUNKSZ) {
chunkmask = ((1ULL << chunksz) - 1);
word = i / BITS_PER_LONG;
_
-
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: 2005-04-08 03:02    [W:0.060 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site