public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: must_check attributes for bitmap functions.
Date: Tue, 1 Aug 2006 14:53:21 -0400	[thread overview]
Message-ID: <20060801185321.GR22240@redhat.com> (raw)

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 <davej@redhat.com>


--- linux-2.6.15.noarch/include/linux/bitmap.h~	2006-02-17 14:05:18.000000000 -0500
+++ linux-2.6.15.noarch/include/linux/bitmap.h	2006-02-17 14:06:14.000000000 -0500
@@ -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 uns
 		return __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(cons
 		return __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 un
 		return __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 uns
 		return __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 unsi
 		return __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);
 }

-- 
http://www.codemonkey.org.uk

                 reply	other threads:[~2006-08-01 18:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060801185321.GR22240@redhat.com \
    --to=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox