diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-01-28 13:25:10 (GMT) |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-28 17:36:37 (GMT) |
commit | 97cf56697a31e083c04aa3ec30710f24bbdac86f (patch) | |
tree | 1e85e3fc8d79fa854451f4825be029ff71f434fe /drivers/spi/spi-pxa2xx.c | |
parent | 97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff) | |
download | linux-97cf56697a31e083c04aa3ec30710f24bbdac86f.tar.xz |
spi/rockchip: avoid uninitialized-use warning
We currently get a warning about potentially uninitialized variables
in the rockchip spi driver, at least in certain toolchain versions:
spi/spi-rockchip.c: In function 'rockchip_spi_prepare_dma':
include/linux/dmaengine.h:796:2: warning: 'txdesc' may be used uninitialized in this function
include/linux/dmaengine.h:796:2: warning: 'rxdesc' may be used uninitialized in this function
The reason seems to be that gcc cannot know whether the value
of the rs->rx and rs->tx variables change between the two points
these are accessed.
The code is actually correct, but to make this clearer to the
compiler, this changes the conditionals to test for the local
rxdesc/txdesc variables instead, which it knows won't change.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
0 files changed, 0 insertions, 0 deletions