MIPS: microMIPS: Fix detection of addiusp instruction
authorMatt Redfearn <matt.redfearn@imgtec.com>
Tue, 8 Aug 2017 12:22:31 +0000 (13:22 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 6 Sep 2017 11:19:08 +0000 (13:19 +0200)
commitb332fec0489295ee7a0aab4a89bd7257cd126f7f
tree135e65a5deb1acf66b651f5981a7406936b27a8d
parent11887ed172a6960673f130dad8f8fb42778f64d7
MIPS: microMIPS: Fix detection of addiusp instruction

The addiusp instruction uses the pool16d opcode, with bit 0 of the
immediate set. The test for the addiusp opcode erroneously did a logical
and of the immediate with mm_addiusp_func, which has value 1, so this
test always passes when the immediate is non-zero.

Fix the test by replacing the logical and with a bitwise and.

Fixes: 34c2f668d0f6 ("MIPS: microMIPS: Add unaligned access support.")
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/16954/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/process.c