]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
drm/amd/display: Fix implicit narrowing conversions in modules
authorGaghik Khachatrian <gaghik.khachatrian@amd.com>
Mon, 23 Mar 2026 19:26:53 +0000 (15:26 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Apr 2026 19:21:29 +0000 (15:21 -0400)
commit355408042a4ddbd56548d7e7f6ab49731a7efa4b
tree549e883abc6110c3a15576e9569b950459d445f4
parent463a84daf2875582f5fd6d0a27bf80bcc7e73192
drm/amd/display: Fix implicit narrowing conversions in modules

[Why]: Implicit narrowing of wider integer types (unsigned int, uint64_t)
into narrower fields (uint8_t, uint16_t, unsigned short) has potential
truncation issues.

[How]: For each warning site, added ASSERT(<value> <= 0xFFFF/0xFF) for
debug-mode bounds verification followed by an explicit cast. Typed
intermediate variables introduced where needed for clarity.

No functional change intended.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Gaghik Khachatrian <gaghik.khachatrian@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/freesync/freesync.c
drivers/gpu/drm/amd/display/modules/power/power_helpers.c
drivers/gpu/drm/amd/display/modules/vmid/vmid.c