]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Fix unsigned comparison with less than zero
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Mon, 1 Jul 2024 02:50:28 +0000 (10:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 2 Jul 2024 22:04:27 +0000 (18:04 -0400)
commitfcb2f988ef4905ac787fef040a28d0f0f610ad83
tree4d8aaaa73f8f01c95d3dfd60adde16457e3e1f8d
parentf340f2bad1c790d2759680b7df853f548e7beadc
drm/amd/display: Fix unsigned comparison with less than zero

The return value from the call to dml21_find_dc_pipes_for_plane() is int.
However, the return value is being assigned to an unsigned int variable
'num_pipes', the condition if(num_pipes <= 0) is not rigorous enough,
so making 'num_pipes' an int.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:318:6-15: WARNING: Unsigned expression compared with zero: num_pipes <= 0.
./drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:360:6-15: WARNING: Unsigned expression compared with zero: num_pipes <= 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9454
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c