• Arnd Bergmann's avatar
    spi: fix counting in spi-loopback-test code · ebea7c05
    Arnd Bergmann authored
    These variables are always used uninitialized:
    
    drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
    drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
    drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    Adding an explicit initialization seems to be the only
    workable solution here, to make the code behave correctly
    and build without warning.
    
    Fixes: 84e0c4e5 ("spi: add loopback test driver to allow for spi_master regression tests")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    ebea7c05
spi-loopback-test.c 24.3 KB