drm/amdgpu: Change assignment for a variable in amdgpu_cgs_acpi_eval_object()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 16 Jul 2016 13:05:45 +0000 (15:05 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 29 Jul 2016 18:36:54 +0000 (14:36 -0400)
Indicate successful function execution only at the end.
Thus omit initialisation for the variable "result" at the beginning.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c

index f88e82a..d637b8f 100644 (file)
@@ -920,7 +920,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
        struct cgs_acpi_method_argument *argument;
        uint32_t i, count;
        acpi_status status;
-       int result = 0;
+       int result;
 
        handle = ACPI_HANDLE(&adev->pdev->dev);
        if (!handle)
@@ -1061,6 +1061,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
                params++;
        }
 
+       result = 0;
 free_obj:
        kfree(obj);
 free_input: