diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-01-12 23:55:09 +0300 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-01-12 23:55:09 +0300 |
commit | 014bcd28a04ec085940ea3125f5ea91b16a1945d (patch) | |
tree | e193fea269d089bc05953d3c3ae79f49ffe31b4c /drivers/hwmon | |
parent | 5d84291da3a594ac391c85296e28f41ff92da0cf (diff) | |
download | linux-014bcd28a04ec085940ea3125f5ea91b16a1945d.tar.xz |
hwmon: (w83795) Silent false warning from gcc
The code triggers a false warning with older versions of gcc:
w83795.c: In function 'w83795_update_device':
w83795.c:475: warning: 'lsb' may be used uninitialized in this function
I admit that the code is a little tricky, but I see no way to write it
differently without hurting performance. So let's just silent the
warning with a needless initialization.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/w83795.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index cdbc7448491e..845232d7f611 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c @@ -458,6 +458,7 @@ static void w83795_update_limits(struct i2c_client *client) { struct w83795_data *data = i2c_get_clientdata(client); int i, limit; + u8 lsb; /* Read the voltage limits */ for (i = 0; i < ARRAY_SIZE(data->in); i++) { @@ -479,9 +480,8 @@ static void w83795_update_limits(struct i2c_client *client) } /* Read the fan limits */ + lsb = 0; /* Silent false gcc warning */ for (i = 0; i < ARRAY_SIZE(data->fan); i++) { - u8 lsb; - /* Each register contains LSB for 2 fans, but we want to * read it only once to save time */ if ((i & 1) == 0 && (data->has_fan & (3 << i))) |