Skip to contentSkip to conversation

drm:amdgpu:remove unneeded variable

PATCH Applied [email protected] 2 participants 2 messages Dec 9, 2021 – Dec 13, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm:amdgpu:remove unneeded variable

From: chiminghao <[email protected]>

return value form directly instead of
taking this in another redundant variable.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c | 5 +----
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c     | 6 ++----
 2 files changed, 3 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c +1 -4
index 5cf142e849bb..fb92f827eeb7 100644
@@ -37,12 +37,9 @@
 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);
 }
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -4
index cb82404df534..269a7b04b7e7 100644
@@ -1742,7 +1742,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);
@@ -1777,9 +1777,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);
 }
 
 /**
Signature · 1 line
2.25.1
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 58 lines · On Thu, Dec 9, 2021 at 11:56 AM <[email protected]> wrote:

From: chiminghao <[email protected]>

return value form directly instead of
taking this in another redundant variable.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c | 5 +----
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c     | 6 ++----
 2 files changed, 3 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c +1 -4
index 5cf142e849bb..fb92f827eeb7 100644
@@ -37,12 +37,9 @@
 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);
 }
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -5
index cb82404df534..269a7b04b7e7 100644
@@ -1742,7 +1742,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);
@@ -1777,9 +1777,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);
 }
 
 /**
--

2.25.1