From nobody Mon Apr 6 16:29:34 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73116C433F5 for ; Tue, 4 Oct 2022 10:21:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbiJDKVw (ORCPT ); Tue, 4 Oct 2022 06:21:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiJDKVl (ORCPT ); Tue, 4 Oct 2022 06:21:41 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 518592CE14; Tue, 4 Oct 2022 03:21:39 -0700 (PDT) Received: from [192.168.10.9] (unknown [39.45.148.204]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id C775D660225F; Tue, 4 Oct 2022 11:21:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1664878897; bh=kCRfJ9AaObCTjuMjz/60HoCPWoad2V9bCCyPAOpjvdw=; h=Date:Cc:To:From:Subject:From; b=MHjFcUDlBvTz76+UUO+VE8j0qQs95Z2vH5n9LKMosEviQfegqNYyh7iKn8LBzH8df w81mgNZzNP8KWWMjsZPy7CuntUVZSUdwBneEBwEGU+vjiD3+SCGmyFsqQEDy3aMAFK QKmt/4ym7sJrNZq0XP9PNZ2Q8Xr2NKwZq5gsDfxTY/d9K8Vs13c7TnlmVQrRJtapgX G0MKNEuUNTg4tCJa3qete5UujYXHAob7JotlR+UdBt6vHQ7fX3mwY2V3s27lPfSYI1 FdDD+1X4DSQBqNrisJoTYUpfDYbVRC7NPRYU9zFeq3ffKbjwrJlX30TVfpy4u7sCTW YF7m2iSEhharg== Message-ID: <6ffc4718-afb3-883e-418c-79376082ec7a@collabora.com> Date: Tue, 4 Oct 2022 15:21:30 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Cc: usama.anjum@collabora.com, LKML , Collabora Kernel ML , kernel-janitors , amd-gfx@lists.freedesktop.org Content-Language: en-US To: Hawking Zhang , =?UTF-8?Q?Christian_K=c3=b6nig?= , Alex Deucher , David Airlie , Daniel Vetter From: Muhammad Usama Anjum Subject: [Bug report] Possible wrong condition Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 >=3D 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 =3D=3D 2 && version_minor =3D=3D 1) adev->gfx.rlc.is_rlc_v2_1 =3D true; + // The following condition is always true as version_minor is unsigned. + // Why is this condition needed at all? if (version_minor >=3D 0) { err =3D amdgpu_gfx_rlc_init_microcode_v2_0(adev); if (err) { --=20 Muhammad Usama Anjum