]> git.baikalelectronics.ru Git - kernel.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)
commit2151610242e678c78e88cb1be796a33bd7b4e99d
tree663a89d21ba00dc1a003be334e5e067b9e44936b
parent3ac0e6521b5658fec83211cc69e2e0900fb60a2d
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: 3ac0e6521b56 ("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