]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: mpc5xxx-psc: Fix unsigned expression compared with zero
authorLi Zetao <lizetao1@huawei.com>
Thu, 3 Aug 2023 13:48:05 +0000 (21:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:03 +0000 (09:48 +0200)
commitda2f98973b70a43f6df7e8264f0a7266d76aa297
tree1deb876772059dad868b619d42d73d9bb16245d8
parent713f9c030837b21f5b3ae294043b93d5750eca88
spi: mpc5xxx-psc: Fix unsigned expression compared with zero

[ Upstream commit de5e92cb5cefd2968b96075995a36e28298edf71 ]

There is two warnings reported by coccinelle:

./drivers/spi/spi-mpc512x-psc.c:493:5-13: WARNING:
Unsigned expression compared with zero: mps -> irq     <     0
./drivers/spi/spi-mpc52xx-psc.c:332:5-13: WARNING:
Unsigned expression compared with zero: mps -> irq     <     0

The commit "208ee586f862"
("spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable")
was to check whether the IRQ resource is unavailable. When the IRQ
resource is unavailable, an error code is returned, however, the type
of "mps->irq" is "unsigned int", causing the error code to flip. Modify
the type of "mps->irq" to solve this problem.

Fixes: 208ee586f862 ("spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable")
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230803134805.1037251-1-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-mpc512x-psc.c