Patch "sh: cmpxchg: fix a bit shift bug in big_endian os" has been added to the 4.7-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
sh: cmpxchg: fix a bit shift bug in big_endian os
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
sh-cmpxchg-fix-a-bit-shift-bug-in-big_endian-os.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
ff18143ceed3424b7d6cdb8659b9692fa734f0d8Mon Sep 17 00:00:00 2001
From: Pan Xinhui <[email protected]>
Date: Wed, 20 Apr 2016 14:41:00 +0800
Subject: sh: cmpxchg: fix a bit shift bug in big_endian os
From: Pan Xinhui <[email protected]>
commit ff18143ceed3424b7d6cdb8659b9692fa734f0d8 upstream.
Correct bitoff in big endian OS.
Current code works correctly for 1 byte but not for 2 bytes.
--- arch/sh/include/asm/cmpxchg-xchg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/include/asm/cmpxchg-xchg.h +1 -1
@@ -21,7 +21,7 @@ static inline u32 __xchg_cmpxchg(volatilint off = (unsigned long )ptr %sizeof (u32);volatile u32 *p = ptr - off;#ifdef __BIG_ENDIAN -int bitoff = (sizeof (u32) -1 - off) *BITS_PER_BYTE ; +int bitoff = (sizeof (u32) - size - off) *BITS_PER_BYTE ;#else int bitoff = off *BITS_PER_BYTE ;#endif
Patches currently in stable-queue which might be from [email protected] are
queue-4.7/sh-cmpxchg-fix-a-bit-shift-bug-in-big_endian-os.patch