Skip to contentSkip to conversation

Possible wrong condition

Bug report Muhammad Usama Anjum 1 participant 1 message Oct 4, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hello,

It seems there is some dead or not-needed code. Either the if condition isn't needed or condition is wrong. As this greater-than-or-equal-to-zero comparison of an unsigned value is always true. "version_minor >= 0". Please have a look at it.

(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
index 012b72d00e04..be9a6aad8541 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c +0 -0
@@ -526,6 +526,8 @@ int amdgpu_gfx_rlc_init_microcode(struct

amdgpu_device *adev,

        if (version_major == 2 && version_minor == 1)
                adev->gfx.rlc.is_rlc_v2_1 = true;

+ // The following condition is always true as version_minor is
unsigned.
+ // Why is this condition needed at all?

        if (version_minor >= 0) {
                err = amdgpu_gfx_rlc_init_microcode_v2_0(adev);
                if (err) {
Signature · 1 line
Muhammad Usama Anjum