diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-01 21:07:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-09 18:52:27 +0300 |
commit | a152a7b411a54b73707f37ab753cd907c3edfc56 (patch) | |
tree | d9c6f0b9854a7fdb2c1bcc8defca38513648c453 /drivers/i2c | |
parent | 93d6f0841eef6304c13803a84588f00476b06a14 (diff) | |
download | linux-a152a7b411a54b73707f37ab753cd907c3edfc56.tar.xz |
gcc-9: don't warn about uninitialized variable
commit cf676908846a06443fa5e6724ca3f5dd7460eca1 upstream.
I'm not sure what made gcc warn about this code now. The 'ret' variable
does end up initialized in all cases, but it's definitely not obvious,
so the compiler is quite reasonable to warn about this.
So just add initialization to make it all much more obvious both to
compilers and to humans.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 5b0e1d9e5adc..1de10e5c70d7 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -185,7 +185,7 @@ static int i2c_generic_bus_free(struct i2c_adapter *adap) int i2c_generic_scl_recovery(struct i2c_adapter *adap) { struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; - int i = 0, scl = 1, ret; + int i = 0, scl = 1, ret = 0; if (bri->prepare_recovery) bri->prepare_recovery(adap); |