Skip to content

Commit

Permalink
platform: x86: asus-wmi.c: Cleaning up uninitialized variables
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rickard Strandqvist authored and Matthew Garrett committed Jun 10, 2014
1 parent 14627e3 commit 8ad3be1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 8ad3be1

Please sign in to comment.