ACPI / fan: Initialize acpi_state variable
authorNaresh Bhat <naresh.bhat@linaro.org>
Mon, 1 Jul 2013 14:21:00 +0000 (19:51 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 4 Jul 2013 11:33:25 +0000 (13:33 +0200)
Make the following compiler warning go away:

 CC      drivers/acpi/fan.o
drivers/acpi/fan.c: In function ‘fan_get_cur_state’:
drivers/acpi/fan.c:96:9: warning: ‘acpi_state’ may be used uninitialized in this function [-Wuninitialized]

by initializing the local variable acpi_state in fan_get_cur_state().

[rjw: Changelog]
Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/fan.c

index 8d1c0105e1138141aa2b6c988657d261617546ee..5b02a0aa540cfa122ecfd8481d38162076cefbde 100644 (file)
@@ -84,7 +84,7 @@ static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
 {
        struct acpi_device *device = cdev->devdata;
        int result;
-       int acpi_state;
+       int acpi_state = ACPI_STATE_D0;
 
        if (!device)
                return -EINVAL;