[PATCH v2 1/3] drm/amd/display: Update ternary operator with min_t() in 'do_aquire_global_lock'

Srinivasan Shanmugam srinivasan.shanmugam at amd.com
Wed Aug 16 11:32:11 UTC 2023


Fixes the following coccicheck:

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:9079:12-13: WARNING opportunity for min()

Cc: Hamza Mahfooz <hamza.mahfooz at amd.com>
Cc: Harry Wentland <harry.wentland at amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
Cc: Alex Deucher <alexander.deucher at amd.com>
Cc: Christian König <christian.koenig at amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index b1245b732cc9..e8c6949fa5a1 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9076,7 +9076,7 @@ static int do_aquire_global_lock(struct drm_device *dev,
 		drm_crtc_commit_put(commit);
 	}
 
-	return ret < 0 ? ret : 0;
+	return min_t(long, ret, 0);
 }
 
 static void get_freesync_config_for_crtc(
-- 
2.25.1



More information about the amd-gfx mailing list