lkml.org 
[lkml]   [2006]   [Jun]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 4 Jun 2006 16:45:48 +0800
FromWu Fengguang <>
Subject[minor fix] radixtree: regulate tag get return value
Andrew, this small patch makes the radixtree tester program from
        http://www.zip.com.au/~akpm/linux/patches/stuff/rtth.tar.gz
run OK, with the latest radix tree code in linux-2.6.17-rc5-mm2.

It regulates the return value to 0/1 for functions
radix_tree_tag_get() and radix_tree_tagged().

Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
---
--- linux.orig/lib/radix-tree.c
+++ linux/lib/radix-tree.c
@@ -156,7 +156,7 @@ static inline void tag_clear(struct radi
 static inline int tag_get(struct radix_tree_node *node, unsigned int tag,
 		int offset)
 {
-	return test_bit(offset, node->tags[tag]);
+	return !! test_bit(offset, node->tags[tag]);
 }
 
 static inline void root_tag_set(struct radix_tree_root *root, unsigned int tag)
@@ -177,7 +177,7 @@ static inline void root_tag_clear_all(st
 
 static inline int root_tag_get(struct radix_tree_root *root, unsigned int tag)
 {
-	return root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT));
+	return !! (root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT)));
 }
 
 /*
-
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-06-04 10:48    [from the cache]
©2003-2008