diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-08-16 11:15:26 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-08-22 17:04:05 -0400 |
commit | 858a914324c7786f483661e3a89bc8fbe50f1b9d (patch) | |
tree | 47e3d189b00103c44e0f2d10fe758861367dec8c /drivers/hwmon | |
parent | fcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c (diff) |
hwmon: (ntc_thermistor) Simplify if sequence
Replace unnecessary if with else statement.
This fixes the following (false) compile warning reported with some combinations
of C compiler version and configuration.
drivers/hwmon/ntc_thermistor.c: In function 'ntc_show_temp':
drivers/hwmon/ntc_thermistor.c:225: warning: 'low' may be used uninitialized in
this function
drivers/hwmon/ntc_thermistor.c:225: note: 'low' was declared here
drivers/hwmon/ntc_thermistor.c:225: warning: 'high' may be used uninitialized in
this function
drivers/hwmon/ntc_thermistor.c:225: note: 'high' was declared here
drivers/hwmon/ntc_thermistor.c:294: warning: 'temp' may be used uninitialized in
this function
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index d7926f4336b5..eab11615dced 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c | |||
@@ -211,8 +211,7 @@ static int lookup_comp(struct ntc_data *data, | |||
211 | if (data->comp[mid].ohm <= ohm) { | 211 | if (data->comp[mid].ohm <= ohm) { |
212 | *i_low = mid; | 212 | *i_low = mid; |
213 | *i_high = mid - 1; | 213 | *i_high = mid - 1; |
214 | } | 214 | } else { |
215 | if (data->comp[mid].ohm > ohm) { | ||
216 | *i_low = mid + 1; | 215 | *i_low = mid + 1; |
217 | *i_high = mid; | 216 | *i_high = mid; |
218 | } | 217 | } |