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: 8cbe3648aa ("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>
This commit is contained in:
George Zhang 2026-07-03 09:44:45 -04:00 committed by Alex Deucher
parent 6d9cea05db
commit a733b7bee1

View File

@ -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 {