• Geert Uytterhoeven's avatar
    iio: pressure: zpa2326: Remove always-true check which confuses gcc · f61dfff2
    Geert Uytterhoeven authored
    With gcc 4.1.2:
    
        drivers/iio/pressure/zpa2326.c: In function ‘zpa2326_wait_oneshot_completion’:
        drivers/iio/pressure/zpa2326.c:868: warning: ‘ret’ may be used uninitialized in this function
    
    When testing for "timeout < 0", timeout is already guaranteed to be
    strict negative, so the branch is always taken, and ret is thus always
    initialized.  But (some version of) gcc is not smart enough to notice.
    
    Remove the check to fix this.
    As there is no other code in between assigning the error codes and
    returning them, the error codes can be returned immediately, and the
    intermediate variable can be dropped.
    Drop the "else" to please checkpatch.
    
    Fixes: e7215fe4 ("iio: pressure: zpa2326: report interrupted case as failure")
    Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    f61dfff2
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
abp060mg.c Loading commit data...
bmp280-core.c Loading commit data...
bmp280-i2c.c Loading commit data...
bmp280-regmap.c Loading commit data...
bmp280-spi.c Loading commit data...
bmp280.h Loading commit data...
cros_ec_baro.c Loading commit data...
hid-sensor-press.c Loading commit data...
hp03.c Loading commit data...
hp206c.c Loading commit data...
mpl115.c Loading commit data...
mpl115.h Loading commit data...
mpl115_i2c.c Loading commit data...
mpl115_spi.c Loading commit data...
mpl3115.c Loading commit data...
ms5611.h Loading commit data...
ms5611_core.c Loading commit data...
ms5611_i2c.c Loading commit data...
ms5611_spi.c Loading commit data...
ms5637.c Loading commit data...
st_pressure.h Loading commit data...
st_pressure_buffer.c Loading commit data...
st_pressure_core.c Loading commit data...
st_pressure_i2c.c Loading commit data...
st_pressure_spi.c Loading commit data...
t5403.c Loading commit data...
zpa2326.c Loading commit data...
zpa2326.h Loading commit data...
zpa2326_i2c.c Loading commit data...
zpa2326_spi.c Loading commit data...