[PATCH 3/3] drm/amdgpu: clean up code to make it easier to understand

Alex Xie AlexBin.Xie at amd.com
Tue May 30 21:47:48 UTC 2017


 The original code convert pointer from amdgpu_crtc to
 drm_crtc then later convert the pointer back.
 It is difficult to understand why it was written
 that way.

Signed-off-by: Alex Xie <AlexBin.Xie at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 4dd83a3..7317fc9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -258,8 +258,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 		for (i = 0, found = 0; i < adev->mode_info.num_crtc; i++) {
 			crtc = (struct drm_crtc *)minfo->crtcs[i];
 			if (crtc && crtc->base.id == info->mode_crtc.id) {
-				struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
-				ui32 = amdgpu_crtc->crtc_id;
+				ui32 = minfo->crtcs[i]->crtc_id;
 				found = 1;
 				break;
 			}
-- 
2.7.4



More information about the amd-gfx mailing list