This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / lib / radix-tree.c
index 8938227..04d6643 100644 (file)
@@ -485,8 +485,8 @@ __lookup(struct radix_tree_root *root, void **results, unsigned long index,
                for ( ; i < RADIX_TREE_MAP_SIZE; i++) {
                        if (slot->slots[i] != NULL)
                                break;
-                       index &= ~((1 << shift) - 1);
-                       index += 1 << shift;
+                       index &= ~((1UL << shift) - 1);
+                       index += 1UL << shift;
                        if (index == 0)
                                goto out;       /* 32-bit wraparound */
                }
@@ -575,8 +575,8 @@ __lookup_tag(struct radix_tree_root *root, void **results, unsigned long index,
                                BUG_ON(slot->slots[i] == NULL);
                                break;
                        }
-                       index &= ~((1 << shift) - 1);
-                       index += 1 << shift;
+                       index &= ~((1UL << shift) - 1);
+                       index += 1UL << shift;
                        if (index == 0)
                                goto out;       /* 32-bit wraparound */
                }
@@ -701,8 +701,10 @@ void *radix_tree_delete(struct radix_tree_root *root, unsigned long index)
                for (tag = 0; tag < RADIX_TREE_TAGS; tag++) {
                        int idx;
 
-                       if (!tags[tag])
-                               tag_clear(pathp[0].node, tag, pathp[0].offset);
+                       if (tags[tag])
+                               continue;
+
+                       tag_clear(pathp[0].node, tag, pathp[0].offset);
 
                        for (idx = 0; idx < RADIX_TREE_TAG_LONGS; idx++) {
                                if (pathp[0].node->tags[tag][idx]) {