]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] work around gcc bug in bitmap.c
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 13:16:07 +0000 (05:16 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 13:16:07 +0000 (05:16 -0800)
gcc miscompiles this. Scary.

lib/bitmap.c

index fd2b38f8db49c414ae4b0bb7298fc45662b0fd0a..6462e071167bd334d135567b6aa8541cb32c9aa6 100644 (file)
@@ -51,8 +51,9 @@ EXPORT_SYMBOL(bitmap_equal);
 void bitmap_complement(unsigned long *bitmap, int bits)
 {
        int k;
+       int nr = BITS_TO_LONGS(bits);
 
-       for (k = 0; k < BITS_TO_LONGS(bits); ++k)
+       for (k = 0; k < nr; ++k)
                bitmap[k] = ~bitmap[k];
 }
 EXPORT_SYMBOL(bitmap_complement);