MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads
authorPaul Burton <paul.burton@mips.com>
Mon, 16 Jul 2018 15:26:36 +0000 (08:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:10 +0000 (08:38 +0200)
commitc2bd54bc222050856992e011e3a45b03e07cb647
treefe3f2159dd4be21a7c0bb5aec9ce0852e8e26c79
parent55bdb77aa991c2dfd107c4805e334ad571f73a4f
MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads

[ Upstream commit cd87668d601f622e0ebcfea4f78d116d5f572f4d ]

The PCI_OHCI_INT_REG case in pci_ohci_read_reg() contains the following
if statement:

  if ((lo & 0x00000f00) == CS5536_USB_INTR)

CS5536_USB_INTR expands to the constant 11, which gives us the following
condition which can never evaluate true:

  if ((lo & 0xf00) == 11)

At least when using GCC 8.1.0 this falls foul of the tautoligcal-compare
warning, and since the code is built with the -Werror flag the build
fails.

Fix this by shifting lo right by 8 bits in order to match the
corresponding PCI_OHCI_INT_REG case in pci_ohci_write_reg().

Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/19861/
Cc: Huacai Chen <chenhc@lemote.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/loongson64/common/cs5536/cs5536_ohci.c