platform: x86: asus-wmi.c: Cleaning up uninitialized variables
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Sun, 1 Jun 2014 12:58:52 +0000 (14:58 +0200)
committerMatthew Garrett <matthew.garrett@nebula.com>
Tue, 10 Jun 2014 23:11:08 +0000 (19:11 -0400)
There is a risk that the variable will be used without being initialized.

This was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
drivers/platform/x86/asus-wmi.c

index 91ef69a52263e86d4bfbdad60ea4e26ea70185d5..3c6ccedc82b6239fdee1bfb6925e0e3b032142c4 100644 (file)
@@ -266,7 +266,7 @@ static int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
        struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
        acpi_status status;
        union acpi_object *obj;
-       u32 tmp;
+       u32 tmp = 0;
 
        status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 1, method_id,
                                     &input, &output);
@@ -277,8 +277,6 @@ static int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
        obj = (union acpi_object *)output.pointer;
        if (obj && obj->type == ACPI_TYPE_INTEGER)
                tmp = (u32) obj->integer.value;
-       else
-               tmp = 0;
 
        if (retval)
                *retval = tmp;