diff options
| author | George Zhang <george.zhang@amd.com> | 2026-07-03 09:44:45 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-07-08 14:20:30 -0400 |
| commit | a733b7bee13c6f1085979819a3154d6d12aa220b (patch) | |
| tree | 0d05b215510b0d7a298d4bfc2d949c929a84e551 /drivers/gpu/drm | |
| parent | 6d9cea05db72476ea11a72a8e1e67161e5e48b01 (diff) | |
| download | linux-next-a733b7bee13c6f1085979819a3154d6d12aa220b.tar.gz linux-next-a733b7bee13c6f1085979819a3154d6d12aa220b.zip | |
drm/amd/display: Fix sign mismatch warning
Using mismatched signedness (int and uint32_t) causes a -Wsign-compare
warning. Fix it by changing the min macro to min_t to explicitly cast.
Fixes: 8cbe3648aa86 ("drm/amd/display: clamp DMUB AUX reply length to payload buffer")
Signed-off-by: George Zhang <george.zhang@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c index 0aa99d1a542f..2692d1890ba2 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c @@ -799,8 +799,8 @@ int amdgpu_dm_process_dmub_aux_transfer_sync( /*write req may receive a byte indicating partially written number as well*/ if (p_notify->aux_reply.length && payload->data) { /* Bound the reply to the scratch buffer it was read into. */ - ret = min((uint32_t)p_notify->aux_reply.length, - (uint32_t)sizeof(p_notify->aux_reply.data)); + ret = min_t(uint32_t, p_notify->aux_reply.length, + sizeof(p_notify->aux_reply.data)); /* * During a write-status-update retry the caller zeroes @@ -809,7 +809,7 @@ int amdgpu_dm_process_dmub_aux_transfer_sync( * so only clamp to payload->length for regular transfers. */ if (!payload->write_status_update) - ret = min(ret, payload->length); + ret = min_t(int, ret, payload->length); memcpy(payload->data, p_notify->aux_reply.data, ret); } else { |
