aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/acpi_power_meter.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-03-28 12:03:26 -0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-04-09 15:17:37 -0400
commit776cdc11b3b0fc21e34600e22abe1c8209d2f3f0 (patch)
tree88bc3de50013a9e63b36fbfe82a199a447dc74f4 /drivers/hwmon/acpi_power_meter.c
parent8528e07edfc6ac5a793509f305b9c3c4fb3672c0 (diff)
hwmon: (acpi_power_meter) Fix compiler warning seen in some configurations
In some configurations, BUG() does not result in an endless loop but returns to the caller. This results in the following compiler warning: drivers/hwmon/acpi_power_meter.c: In function 'show_str': drivers/hwmon/acpi_power_meter.c:380: warning: 'val' may be used uninitialized in this function Fix the warning by setting val to an empty string after BUG(). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Diffstat (limited to 'drivers/hwmon/acpi_power_meter.c')
-rw-r--r--drivers/hwmon/acpi_power_meter.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 145f13580ff0..9140236a0182 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -391,6 +391,7 @@ static ssize_t show_str(struct device *dev,
391 break; 391 break;
392 default: 392 default:
393 BUG(); 393 BUG();
394 val = "";
394 } 395 }
395 396
396 return sprintf(buf, "%s\n", val); 397 return sprintf(buf, "%s\n", val);