Skip to contentSkip to conversation

drm/amdgpu: fix r initial values

PATCH In review Victor Zhao 2 participants 2 messages Apr 27, 2021

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

PATCH 1/1 drm/amdgpu: fix r initial values

Give initial values otherwise sriov will get suspend of IP block <dce_virtual> failed

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -2
index 0f17984fdea4..36fdffd103c0 100644
@@ -1384,7 +1384,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
 	struct drm_crtc *crtc;
 	struct drm_connector *connector;
 	struct drm_connector_list_iter iter;
-	int r;
+	int r = 0;
 
 	/* turn off display hw */
 	drm_modeset_lock_all(dev);
@@ -1431,7 +1431,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev)
 	struct drm_connector *connector;
 	struct drm_connector_list_iter iter;
 	struct drm_crtc *crtc;
-	int r;
+	int r = 0;
 
 	/* pin cursors */
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

Good catch. I think we should probably just return 0 at the end to keep the semantics of the original code before this was broken out into a separate helper function.

Alex

________________________________
From: amd-gfx <[email protected]> on behalf of Victor Zhao <[email protected]>
Sent: Tuesday, April 27, 2021 5:58 AM
To: [email protected] <[email protected]>
Cc: Zhao, Victor <[email protected]>
Subject: [PATCH] drm/amdgpu: fix r initial values

Give initial values otherwise sriov will get suspend of IP block <dce_virtual> failed

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -2
index 0f17984fdea4..36fdffd103c0 100644
@@ -1384,7 +1384,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
         struct drm_crtc *crtc;
         struct drm_connector *connector;
         struct drm_connector_list_iter iter;
-       int r;
+       int r = 0;
 
         /* turn off display hw */
         drm_modeset_lock_all(dev);
@@ -1431,7 +1431,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev)
         struct drm_connector *connector;
         struct drm_connector_list_iter iter;
         struct drm_crtc *crtc;
-       int r;
+       int r = 0;
 
         /* pin cursors */
         list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {

--
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C9611bd0b8cb74a8ac81308d909631004%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637551143345597240%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=okT4wUuJysPl1Fm%2BtdHtw4VgXoLJUhir%2BTa6Uuqpg20%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx