]> asedeno.scripts.mit.edu Git - linux.git/commit
spi: npcm: fix u32 csgpio being checked for less than zero
authorColin Ian King <colin.king@canonical.com>
Wed, 14 Nov 2018 21:42:46 +0000 (21:42 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 14 Nov 2018 22:02:33 +0000 (14:02 -0800)
commit757ec116c9bce4278fa4423039736c832cc63b6f
tree663a89d21ba00dc1a003be334e5e067b9e44936b
parent2a22f1b30cee8d1e104a6c5062a609bedbfd5c39
spi: npcm: fix u32 csgpio being checked for less than zero

The u32 variable csgpio is being checked for an error return
from the call to of_get_named_gpio, however, since this is unsigned
this comparison will always be false. Fix this by making csgpio an
int and fix up the %u format specifiers to %d accordingly.

Detected by CoverityScan, CID#1475476 ("Unsigned compared against 0")

Fixes: 2a22f1b30cee ("spi: npcm: add NPCM PSPI controller driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-npcm-pspi.c