]> git.baikalelectronics.ru Git - kernel.git/commit
spi: npcm: Fix uninitialized variable warning
authorOlof Johansson <olof@lixom.net>
Sat, 17 Nov 2018 03:55:04 +0000 (19:55 -0800)
committerMark Brown <broonie@kernel.org>
Tue, 27 Nov 2018 14:07:08 +0000 (14:07 +0000)
commite7be6d755df106d4aeb4994e1bcfba700e519728
treeea1960e2103d9caa7279917c627b4b10cf6123ea
parent95a52f2eb4aeacf02b3451f234c979f73e56e011
spi: npcm: Fix uninitialized variable warning

The compiler has no way to know that rsize 1 or 2 are the only valid
values. Also simplify the code a bit with early return.

The warning was:

drivers/spi/spi-npcm-pspi.c:215:6: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-npcm-pspi.c