[PATCH 1/2] lib: Fix generic strnlen_user for 32-bit big-endian machines

David Miller davem at davemloft.net
Mon May 28 13:55:41 EST 2012


From: Paul Mackerras <paulus at samba.org>
Date: Mon, 28 May 2012 12:59:56 +1000

> The aligned_byte_mask() definition is wrong for 32-bit big-endian
> machines: the "7-(n)" part of the definition assumes a long is 8
> bytes.  This fixes it by using BITS_PER_LONG - 8 instead of 8*7.
> Tested on 32-bit and 64-bit PowerPC.
> 
> Signed-off-by: Paul Mackerras <paulus at samba.org>

Acked-by: David S. Miller <davem at davemloft.net>


More information about the Linuxppc-dev mailing list