mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
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:
parent
6d9cea05db
commit
a733b7bee1
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user