Re: amd64 bitops fix for -Os

From: Alexandre Oliva
Date: Mon Oct 31 2005 - 15:09:29 EST


On Oct 30, 2005, Pavel Machek <pavel@xxxxxxx> wrote:

>> This patches fixes a bug that comes up when compiling the kernel for
>> x86_64 optimizing for size. It affects 2.6.14 for sure, but I'm
>> pretty sure many earlier kernels are affected as well.

> Is the same problem in i386, too?

No, it doesn't use custom versions of find_first*bit.

>> --- arch/x86_64/lib/bitops.c~ 2005-10-27 22:02:08.000000000 -0200
>> +++ arch/x86_64/lib/bitops.c 2005-10-29 18:24:27.000000000 -0200
>> @@ -1,5 +1,11 @@
>> #include <linux/bitops.h>
>>
>> +#define BITOPS_CHECK_UNDERFLOW_RANGE 0
>> +
>> +#if BITOPS_CHECK_UNDERFLOW_RANGE
>> +# include <linux/kernel.h>
>> +#endif

> Could you drop the ifdefs? Nice for debugging but we don't
> want them in mainline.

Are you absolutely sure we don't? I'd almost left them in, enabled
unconditionally. Note that the ifdef will make no difference
whatsoever for the case I've just fixed, but it would help catch any
other (ab)uses(?) elsewhere that may have gone unnoticed until now.

> Plus you want to add signed-off-by: header and send it to ak@xxxxxxxx
> Pavel

Err... The header was right there. Or do you mean as an e-mail
header, as opposed to a regular line in the e-mail body?

I'll forward the patch to ak.

--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
-
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/