]> git.baikalelectronics.ru Git - kernel.git/commit
slub: fix check_bytes() for slub debugging
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 7 Aug 2011 09:30:38 +0000 (18:30 +0900)
committerPekka Enberg <penberg@kernel.org>
Tue, 9 Aug 2011 13:37:48 +0000 (16:37 +0300)
commit32b723dc4a341ec1ffa64d61ef35897f11c5a288
treef508ace02d80e7b80791aff0ada407ae104de7e3
parentc79c18aafd9769f694759d652ebbacc577697896
slub: fix check_bytes() for slub debugging

The check_bytes() function is used by slub debugging.  It returns a pointer
to the first unmatching byte for a character in the given memory area.

If the character for matching byte is greater than 0x80, check_bytes()
doesn't work.  Becuase 64-bit pattern is generated as below.

value64 = value | value << 8 | value << 16 | value << 24;
value64 = value64 | value64 << 32;

The integer promotions are performed and sign-extended as the type of value
is u8.  The upper 32 bits of value64 is 0xffffffff in the first line, and
the second line has no effect.

This fixes the 64-bit pattern generation.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Matt Mackall <mpm@selenic.com>
Reviewed-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slub.c