mirror of
https://github.com/torvalds/linux.git
synced 2024-10-31 09:11:49 +00:00
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>
This commit is contained in:
parent
8528e07edf
commit
776cdc11b3
@ -391,6 +391,7 @@ static ssize_t show_str(struct device *dev,
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
val = "";
|
||||
}
|
||||
|
||||
return sprintf(buf, "%s\n", val);
|
||||
|
Loading…
Reference in New Issue
Block a user