PATCH: linux-2.4.1/drivers/acpi/amfldio.c will fail if bit_granularity==32

From: Adam J. Richter (adam@yggdrasil.com)
Date: Thu Feb 01 2001 - 00:40:09 EST


        I hope this bug was not the result of my cc'ing Linus
on some emails and not on others, because this bug is a mistake
that I made a few weeks ago and then fixed when it was immediately
pointed out to me by some smart person on the acpi list.

        The test "((1 << bit_granularity) -1) & ~mask" will always
fail on x86+gcc if bit_granularity == 32, because the value of 1<<32
on x86 + gcc-2.95.2 is 1, not 0. The value of 1<<n is not defined
in ANSI C when n >= bitsizeof(result), so we should not do this anyhow.

        Anyhow, here is a patch that should fix the problem.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."


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



This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:11 EST