aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2012-01-26 06:08:41 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-03-18 21:27:41 -0400
commit0fc86eca1b338d06ec500b34ef7def79c32b602b (patch)
tree6e603e2dbfa96122487dce37caeb9e6d877be87a /drivers
parent7599d32b1332546a3c0af17ce925ce7a8e89bfa1 (diff)
hwmon: (applesmc) Silence uninitialized warnings
Some error paths do not set a result, leading to the (false) assumption that the value may be used uninitialized. Set results for those paths as well. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/applesmc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 1b130852e3e1..f082e48ab113 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -344,8 +344,10 @@ static int applesmc_get_lower_bound(unsigned int *lo, const char *key)
344 while (begin != end) { 344 while (begin != end) {
345 int middle = begin + (end - begin) / 2; 345 int middle = begin + (end - begin) / 2;
346 entry = applesmc_get_entry_by_index(middle); 346 entry = applesmc_get_entry_by_index(middle);
347 if (IS_ERR(entry)) 347 if (IS_ERR(entry)) {
348 *lo = 0;
348 return PTR_ERR(entry); 349 return PTR_ERR(entry);
350 }
349 if (strcmp(entry->key, key) < 0) 351 if (strcmp(entry->key, key) < 0)
350 begin = middle + 1; 352 begin = middle + 1;
351 else 353 else
@@ -364,8 +366,10 @@ static int applesmc_get_upper_bound(unsigned int *hi, const char *key)
364 while (begin != end) { 366 while (begin != end) {
365 int middle = begin + (end - begin) / 2; 367 int middle = begin + (end - begin) / 2;
366 entry = applesmc_get_entry_by_index(middle); 368 entry = applesmc_get_entry_by_index(middle);
367 if (IS_ERR(entry)) 369 if (IS_ERR(entry)) {
370 *hi = smcreg.key_count;
368 return PTR_ERR(entry); 371 return PTR_ERR(entry);
372 }
369 if (strcmp(key, entry->key) < 0) 373 if (strcmp(key, entry->key) < 0)
370 end = middle; 374 end = middle;
371 else 375 else