]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MIPS: Fix logic errors in bitops.c
authorDavid Daney <david.daney@cavium.com>
Tue, 26 Feb 2013 22:35:23 +0000 (14:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Apr 2013 16:52:02 +0000 (09:52 -0700)
commit79d7517b899ef695bf0674afb4e5ce1b1a4ecfeb
tree155ec4532a9a6f0d1c9a1a1fbb3e0808bf45a469
parentbbe2d01529084ebb9cc5361ef971ddfa34fdaf4c
MIPS: Fix logic errors in bitops.c

commit 0c81157b46c533139d6be721d41617020c59a2c3 upstream.

commit 92d11594f6 (MIPS: Remove irqflags.h dependency from bitops.h)
factored some of the bitops code out into a separate file
(arch/mips/lib/bitops.c).  Unfortunately the logic converting a bit
mask into a boolean result was lost in some of the functions.  We had:

   int res;
   unsigned long shifted_result_bit;
   .
   .
   .
   res = shifted_result_bit;
   return res;

Which truncates off the high 32 bits (thus yielding an incorrect
value) on 64-bit systems.

The manifestation of this is that a non-SMP 64-bit kernel will not
boot as the bitmap operations in bootmem.c are all screwed up.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: Jim Quinlan <jim2101024@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/4965/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/lib/bitops.c