must_check attributes for bitmap functions.
I just unearthed this old patch I did. I'm fairly certain I did this in response to a bug where one of these functions went unchecked, but I can't seem to find any reference of that bug any more.
Signed-off-by Dave Jones <[email protected]>
include/linux/bitmap.h renamed from include/linux/bitmap.h~ +6 -6
@@ -196,7 +196,7 @@ static inline void bitmap_complement(uns__bitmap_complement (dst, src, nbits); } -static inline int bitmap_equal (const unsigned long *src1, +static inline int __must_check bitmap_equal (const unsigned long *src1,const unsigned long *src2,int nbits) {if (nbits <=BITS_PER_LONG )
@@ -205,7 +205,7 @@ static inline int bitmap_equal(const unsreturn __bitmap_equal (src1, src2, nbits); } -static inline int bitmap_intersects (const unsigned long *src1, +static inline int __must_check bitmap_intersects (const unsigned long *src1,const unsigned long *src2,int nbits) {if (nbits <=BITS_PER_LONG )
@@ -214,7 +214,7 @@ static inline int bitmap_intersects(consreturn __bitmap_intersects (src1, src2, nbits); } -static inline int bitmap_subset (const unsigned long *src1, +static inline int __must_check bitmap_subset (const unsigned long *src1,const unsigned long *src2,int nbits) {if (nbits <=BITS_PER_LONG )
@@ -223,7 +223,7 @@ static inline int bitmap_subset(const unreturn __bitmap_subset (src1, src2, nbits); } -static inline int bitmap_empty (const unsigned long *src,int nbits) +static inline int __must_check bitmap_empty (const unsigned long *src,int nbits) {if (nbits <=BITS_PER_LONG )return ! (*src &BITMAP_LAST_WORD_MASK (nbits));
@@ -231,7 +231,7 @@ static inline int bitmap_empty(const unsreturn __bitmap_empty (src, nbits); } -static inline int bitmap_full (const unsigned long *src,int nbits) +static inline int __must_check bitmap_full (const unsigned long *src,int nbits) {if (nbits <=BITS_PER_LONG )return ! (~(*src) &BITMAP_LAST_WORD_MASK (nbits));
@@ -239,7 +239,7 @@ static inline int bitmap_full(const unsireturn __bitmap_full (src, nbits); } -static inline int bitmap_weight (const unsigned long *src,int nbits) +static inline int __must_check bitmap_weight (const unsigned long *src,int nbits) {return __bitmap_weight (src, nbits); }
Signature · 1 line
http://www.codemonkey.org.uk