Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 70664
b: refs/heads/master
c: 430d275
h: refs/heads/master
v: v3
  • Loading branch information
Peter Lund authored and Linus Torvalds committed Oct 17, 2007
1 parent d92f23f commit 0452335
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22e48eaf587d044ba311a73c6fe0d0deaa8fdb63
refs/heads/master: 430d275a399175c7c0673459738979287ec1fd22
14 changes: 8 additions & 6 deletions trunk/lib/radix-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,12 +1049,14 @@ radix_tree_node_ctor(struct kmem_cache *cachep, void *node)

static __init unsigned long __maxindex(unsigned int height)
{
unsigned int tmp = height * RADIX_TREE_MAP_SHIFT;
unsigned long index = (~0UL >> (RADIX_TREE_INDEX_BITS - tmp - 1)) >> 1;

if (tmp >= RADIX_TREE_INDEX_BITS)
index = ~0UL;
return index;
unsigned int width = height * RADIX_TREE_MAP_SHIFT;
int shift = RADIX_TREE_INDEX_BITS - width;

if (shift < 0)
return ~0UL;
if (shift >= BITS_PER_LONG)
return 0UL;
return ~0UL >> shift;
}

static __init void radix_tree_init_maxindex(void)
Expand Down

0 comments on commit 0452335

Please sign in to comment.