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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Cc: Harry Wentland <harry.wentland@xxxxxxx>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx>
Cc: Aurabindo Pillai <aurabindo.pillai@xxxxxxx>
Cc: Alex Deucher <alexander.deucher@xxxxxxx>
Cc: Christian König <christian.koenig@xxxxxxx>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
---
 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..fa36fc4dfc50 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(ret, (long)0);
 }
 
 static void get_freesync_config_for_crtc(
-- 
2.25.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux