mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Bug report] Possible wrong condition
@ 2022-10-04 10:21 Muhammad Usama Anjum
  0 siblings, 0 replies; only message in thread
From: Muhammad Usama Anjum @ 2022-10-04 10:21 UTC (permalink / raw)
  To: Hawking Zhang, Christian König, Alex Deucher, David Airlie,
	Daniel Vetter
  Cc: usama.anjum, LKML, Collabora Kernel ML, kernel-janitors, amd-gfx

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-04 10:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 10:21 [Bug report] Possible wrong condition Muhammad Usama Anjum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®