[<prev] [next>] [day] [month] [year] [list]
Message-ID: <6ffc4718-afb3-883e-418c-79376082ec7a@collabora.com>
Date: Tue, 4 Oct 2022 15:21:30 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Hawking Zhang <Hawking.Zhang@....com>,
Christian König <christian.koenig@....com>,
Alex Deucher <alexander.deucher@....com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
Cc: usama.anjum@...labora.com, LKML <linux-kernel@...r.kernel.org>,
Collabora Kernel ML <kernel@...labora.com>,
kernel-janitors <kernel-janitors@...r.kernel.org>,
amd-gfx@...ts.freedesktop.org
Subject: [Bug report] Possible wrong condition
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.
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
index 012b72d00e04..be9a6aad8541 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
@@ -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) {
--
Muhammad Usama Anjum
Powered by blists - more mailing lists