OSDN Git Service

drm:amdgpu:remove unneeded variable
authorchiminghao <chi.minghao@zte.com.cn>
Thu, 9 Dec 2021 01:58:23 +0000 (01:58 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Dec 2021 21:34:27 +0000 (16:34 -0500)
return value form directly instead of
taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cm>
Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index a7efca6..a1cbd7c 100644 (file)
 long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
        unsigned int nr = DRM_IOCTL_NR(cmd);
-       int ret;
 
        if (nr < DRM_COMMAND_BASE)
                return drm_compat_ioctl(filp, cmd, arg);
 
-       ret = amdgpu_drm_ioctl(filp, cmd, arg);
-
-       return ret;
+       return amdgpu_drm_ioctl(filp, cmd, arg);
 }
index 9684d86..db2ec84 100644 (file)
@@ -1745,7 +1745,7 @@ static int gmc_v9_0_hw_init(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        bool value;
-       int r, i;
+       int i;
 
        /* The sequence of these two function calls matters.*/
        gmc_v9_0_init_golden_registers(adev);
@@ -1780,9 +1780,7 @@ static int gmc_v9_0_hw_init(void *handle)
        if (adev->umc.funcs && adev->umc.funcs->init_registers)
                adev->umc.funcs->init_registers(adev);
 
-       r = gmc_v9_0_gart_enable(adev);
-
-       return r;
+       return gmc_v9_0_gart_enable(adev);
 }
 
 /**