Skip to contentSkip to conversation

gfp annotations: radix_tree_root

PATCH New Al Viro 1 participant 1 message Oct 10, 2006 Library code

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 gfp annotations: radix_tree_root

struct radix_tree_root has unused upper bits of ->gfp_mask reused for tags bitmap. Annotated.

---
 lib/radix-tree.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
lib/radix-tree.c +3 -3
index 637d556..aa9bfd0 100644
@@ -160,13 +160,13 @@ static inline int tag_get(struct radix_t
 
 static inline void root_tag_set(struct radix_tree_root *root, unsigned int tag)
 {
-	root->gfp_mask |= (1 << (tag + __GFP_BITS_SHIFT));
+	root->gfp_mask |= (__force gfp_t)(1 << (tag + __GFP_BITS_SHIFT));
 }
 
 
 static inline void root_tag_clear(struct radix_tree_root *root, unsigned int tag)
 {
-	root->gfp_mask &= ~(1 << (tag + __GFP_BITS_SHIFT));
+	root->gfp_mask &= (__force gfp_t)~(1 << (tag + __GFP_BITS_SHIFT));
 }
 
 static inline void root_tag_clear_all(struct radix_tree_root *root)
@@ -176,7 +176,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 (__force unsigned)root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT));
 }
 
 /*
Signature · 1 line
1.4.2.GIT