Re: seperator error in __mask_snprintf_len

From: Andi Kleen
Date: Fri Jan 16 2004 - 03:26:38 EST


Andrew Morton <akpm@xxxxxxxx> writes:

> +void bitmap_complement(unsigned long *bitmap, int bits)
> +{
> + int k;
> +
> + for (k = 0; k < BITS_TO_LONGS(bits); ++k)
> + bitmap[k] = ~bitmap[k];
> +}
> +EXPORT_SYMBOL(bitmap_complement);

I actually had to change that one in my NUMA API patchkit (which uses
bitmap functions for its node maps), because gcc 3.2 miscompiled the
loop.

Please add something like that (looks silly, but makes a big
difference):

static inline void bitmap_complement(unsigned long *bitmap, int bits)
{
int k;
+ int max = BITS_TO_LONGS(bits);

- for (k = 0; k < BITS_TO_LONGS(bits); ++k)
+ for (k = 0; k < max; ++k)
bitmap[k] = ~bitmap[k];

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/