Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2702437rwb; Mon, 15 Aug 2022 09:53:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4iY46XnlX5MlpOlolc/IafAv2EVkX4I2/oq+MPphdgTH23MT1eHKv3t0fELLbkZ5emmZUM X-Received: by 2002:a17:907:628f:b0:72f:57da:c33d with SMTP id nd15-20020a170907628f00b0072f57dac33dmr11052190ejc.374.1660582385210; Mon, 15 Aug 2022 09:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660582385; cv=none; d=google.com; s=arc-20160816; b=G/Id7mW2h8I7uLSyTOeoP1XFL2vHWnNzRkqBFhZlL7QyfZ0JtqJrqcfBdVlhp9ybWM COzVmtY3Qf/7pQfP+o/aBpIQuoULmCiKFdERNEJbrSRHVAXfzXDkr8UjQ+c1zNFCPTwS n28Z6JgKlO8a49398nCIeK838o26YDL5X95OYcezS66cJ4ZE1IkFOZYuxeygAt3k0U7m bMU3zCp40PeIElVP+JSTSHSLxrhHEo6/YMxz9zNfb/nCAaaln0+VIEC30LZXM/ZPNxAJ DX+Clx8xvXQ5XeF+r05wUbbtmG9fLAEwKhBI1LvAf7waL1EdgsT1nO5HzsDDUzJxgUBG evaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=rLRqhVPz0hhQSREG0KQPS/nirdZJabRaj8W098mmp6M=; b=xkMWTdLlxQox94iPzbjEuiO9s5n68MVgbek7XiD16HtJvLdkym5oKOUKDiYdzE6UfS pKrf69PBh/yPjDcoUOGqdMcAS+owF9681FWqR8a7ZDPnjczcsfsGSokTwJcmSEymE/Qk 1hWLIeCcaliyZPWRXEmdA8vOVTuwlPsbfmj6N86HmDE1+pn/TF1oOEVKEdClG2YrbxvD J/9gM4ky2Kt+zaKDn7VsdmBHqXB2vkRXYjtRK+eBVZJYszwCr7RlptsGz1JhaOUevWQZ isw7ul8BG9N0/WY/l+u86GXDCOSE3ZRSu7xIcKvexhfs1xKl8ym7bqGekn4yfoW3WSa9 fJUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=0FTKcOkF; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Hf40hsSl; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk31-20020a1709077f9f00b0072f24977c82si7607355ejc.841.2022.08.15.09.52.39; Mon, 15 Aug 2022 09:53:05 -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=@kroah.com header.s=fm1 header.b=0FTKcOkF; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Hf40hsSl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiHOQMN (ORCPT + 99 others); Mon, 15 Aug 2022 12:12:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiHOQML (ORCPT ); Mon, 15 Aug 2022 12:12:11 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924C2D110 for ; Mon, 15 Aug 2022 09:12:10 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id BF8895C00ED; Mon, 15 Aug 2022 12:12:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 15 Aug 2022 12:12:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1660579929; x=1660666329; bh=rLRqhVPz0h hQSREG0KQPS/nirdZJabRaj8W098mmp6M=; b=0FTKcOkFtzuOjeemBBTaEzhrya RIAg0nko8kLNdqeiI0aMLMDbahNLctu/aMg65P1+ARi5z609hMokBOunDc9YTiKl C6gXoSGsXKY5YJAssH96skJ/VAPMnGdi70JXN2P9A9bYnJhSKl6Mfm5QcgqvZvmy yC1+OMu3Ke/AClIvjXWN079RHefo8eLCeA4XxhBdTHtKmpjasHijh7uaogV3Cx/M ixwxo6s39pCUU9V+ORyOzh5Hpy4pUHjXKES/ID4DIb8uGghEBOCDtNaGTTDeB2Sd 6mPd5Ui8GKTDGDCpd3EN8JXUDBOfBOIL8l9wvZSw9Cl7LVVHQzJrcMz78AYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660579929; x=1660666329; bh=rLRqhVPz0hhQSREG0KQPS/nirdZJ abRaj8W098mmp6M=; b=Hf40hsSlIzpjbwJfoFz7iCWzy0PmguLzmLOeuoEetc3l fvV8qHnybM9fqQTTKFys3VCQx0EpCdpK8MYu9eo7TIYuO3Zga3nV9MBFCXdSEDX7 CEytZxtG0DIMlnXmXpWJzrBFAqXUcC1gwbVwg1LRdUN8WNXNcThoyc+5l8TwPife 9/BI2YdgSCgQh7BgH6RXsyDNOB1w2o0Z1pll/BCcYiaYz5LKSrGQBG3zhqSNgxNe NYRIB0s+VEhdarleLfmnEEpT4mYUbmjvKz/TA6vhfVOOuW1smVhYsNEw0Sm/V8Uj 7LXIn2iM6JpPiLOcOmQAqDFN04a5wgriU0tVQGMjQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehvddgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepheegvd evvdeljeeugfdtudduhfekledtiefhveejkeejuefhtdeufefhgfehkeetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorg hhrdgtohhm X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Aug 2022 12:12:08 -0400 (EDT) Date: Mon, 15 Aug 2022 18:12:06 +0200 From: Greg KH To: Khalid Masum Cc: "Dong, Ruijing" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "linux-kernel-mentees@lists.linuxfoundation.org" , Wan Jiabing , David Airlie , "Pan, Xinhui" , "Jiang, Sonny" , Daniel Vetter , "Deucher, Alexander" , "Zhu, James" , "Liu, Leo" , "Koenig, Christian" Subject: Re: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop Message-ID: References: <20220815070056.10816-1-khalid.masum.92@gmail.com> <86088c17-585c-4a53-312d-ef339b824538@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86088c17-585c-4a53-312d-ef339b824538@gmail.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Aug 15, 2022 at 09:11:18PM +0600, Khalid Masum wrote: > On 8/15/22 20:15, Dong, Ruijing wrote: > > [AMD Official Use Only - General] > > > > Sorry, which "r" value was overwritten? I didn't see the point of making this change. > > > > Thanks > > Ruijing > > > > -----Original Message----- > > From: Khalid Masum > > Sent: Monday, August 15, 2022 3:01 AM > > To: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; linux-kernel-mentees@lists.linuxfoundation.org > > Cc: Deucher, Alexander ; Koenig, Christian ; Pan, Xinhui ; David Airlie ; Daniel Vetter ; Zhu, James ; Jiang, Sonny ; Dong, Ruijing ; Wan Jiabing ; Liu, Leo ; Khalid Masum > > Subject: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop > > > > The value assigned from vcn_v4_0_stop_dbg_mode to r is overwritten before it can be used. Remove this assignment. > > > > Addresses-Coverity: 1504988 ("Unused value") > > Fixes: 8da1170a16e4 ("drm/amdgpu: add VCN4 ip block support") > > Signed-off-by: Khalid Masum > > --- > > drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c > > index ca14c3ef742e..80b8a2c66b36 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c > > +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c > > @@ -1154,7 +1154,7 @@ static int vcn_v4_0_stop(struct amdgpu_device *adev) > > fw_shared->sq.queue_mode |= FW_QUEUE_DPG_HOLD_OFF; > > > > if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) { > > - r = vcn_v4_0_stop_dpg_mode(adev, i); > > + vcn_v4_0_stop_dpg_mode(adev, i); > > continue; > > } > > > > -- > > 2.37.1 > > > > After value is overwritten soon right after the diff. > > See: > drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c > > static int vcn_v4_0_stop(struct amdgpu_device *adev) > { > volatile struct amdgpu_vcn4_fw_shared *fw_shared; > ... > > for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { > fw_shared = adev->vcn.inst[i].fw_shared.cpu_addr; > fw_shared->sq.queue_mode |= FW_QUEUE_DPG_HOLD_OFF; > > if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) { > r = vcn_v4_0_stop_dpg_mode(adev, i); > continue; > } > > /* wait for vcn idle */ > r = SOC15_WAIT_ON_RREG(VCN, i, regUVD_STATUS, > UVD_STATUS__IDLE, 0x7); > > Here, any value assigned to r is overwritten before it could > be used. So the assignment in the true branch of the if statement > here can be removed. Why not fix vcn_v4_0_stop_dpg_mode() to not return anything, as it does not, and then remove this assignment as well, which would fix up everything at once to be more obvious what is happening and why. thanks, greg k-h