Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp264153rwb; Tue, 4 Oct 2022 03:50:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7yo646wX1blAs1RYoB5Lj8iTvwLfinR0NtGjeI+JiHLuOzUCgNVSYIPxg651qHQ325gTrq X-Received: by 2002:a17:90b:35c7:b0:205:ff7a:38b7 with SMTP id nb7-20020a17090b35c700b00205ff7a38b7mr16912404pjb.105.1664880650227; Tue, 04 Oct 2022 03:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664880650; cv=none; d=google.com; s=arc-20160816; b=CUdhirRFHC7agJzohCYR6QtxWu3hhEK+jjUw83wgxJnhzf9MLQtjh279MoRq3W9vIA 5UqB58FY4JFYUs8qu/HsnYiWkZKlZBxAjt1Cwu422UcWkK+TlUJB4FK8pQd/NaahPfIs Csav+/00t9CIg9m8kXMu3jv/A4wCPW122g0IKXcBxzK4psXKXKP0AZFab5LsHpPE2BqX VX7rGsd70wihc8r5PuKj8owYlQ3kojQO1hPr6OMdIT4mU5f/wmMVUbGIrHv5rqXkRpC7 DYqjRO66OBT4IE87ea0GwELdbHWWBdpQYGGNKH/tV172y5ShcnCuwrY/tMBqHLQZhJJB R/UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:to :content-language:cc:user-agent:mime-version:date:message-id :dkim-signature; bh=A2kx+QL/x9vKxU4RihG+SZDDaTT1Ie39ZKlXMjXbHo0=; b=DOM/jpuA7H0p2XmxW/NjjE4XqTvFi2XfPPtkeZ8Ubh9F5GT/idaHvJH/TkGqp+4nqT bqrNOaZN/ADco5Pxv/i5LRnpATscSz8PVbOavSEEnFqccPSpXutIrjcor861joWUA+Zw aH7ynX0t88wQ7H0KcTXK2Jm5YfP6Q6TFL7BrwLkZOyA7IULDo8KG5EJj4D/jlO9m+9Nu 0uCkWqiJBxnbC9v2Y9SYmWYGxsbY4qu6CPi8zv5F920Xb/38c13QqNzQXkNy9BrOmZi3 1KrHv8I4kSyWv4ktRpze+VgKRKwyeohfJdPA7BuOqUmLG9bZYR8uLGBW8odCuRzvGYur 6mpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MHjFcUDl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cc4-20020a17090af10400b001fd70129092si2223505pjb.15.2022.10.04.03.50.38; Tue, 04 Oct 2022 03:50:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MHjFcUDl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiJDKVt (ORCPT + 99 others); Tue, 4 Oct 2022 06:21:49 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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