Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2158294rwd; Tue, 13 Jun 2023 21:36:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7P4FiAMuupIhI4JBUMnecMr+AneYijo0zHaXjF/wgoF21CUThdPzHM7Y4Rr5SfYPLpVy3Y X-Received: by 2002:aa7:de1a:0:b0:514:9e81:9070 with SMTP id h26-20020aa7de1a000000b005149e819070mr8038605edv.15.1686717419377; Tue, 13 Jun 2023 21:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686717419; cv=none; d=google.com; s=arc-20160816; b=r+Q3sLNG+BSBorHsfm71Vz+pJ1dcg55CcRIQ6+LF3jGx2GX4MveaECcBTpKCh4YoTr J3jl8CF3cYRhzoV4REkR4uHSn5zI3PO7ZbX2Dg/YM7mtGfuszd2PnU6BD1/O31kXIWMj 8jfezkivHDznLzi6UtBthi4qvpb/wkpRvj9G11hW9BUXaZ8/EDblMEA45ZmasBXqK3Pi usYqgMZlA2lXjaeJriUtH33gSAFh+tHo0F5nv0eeLlMvz06snLmbSYea9K4WnMeTd6qC DD04kvEN2VKnADOpQsR9mNqfPg6XYktor4s/1YDF4XF6NzOmFW1NgXXuSZMBpeNqQ0zW g2TA== 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:dkim-signature; bh=wvvRc9qy6Ni7t/b7z+9GETWf6P/wewVtlrltmdxCvjw=; b=UmbUSrEDORYrr2yhfkb0fU7/7lpftJRzikRPvpnTkhXA8mBWTtb6+RnLI7sIQfu2xM hrnvodjgzKyINnhGSCwZBzmkfgU2Ik8aXZ5FqTEJ6eHZMJ1/LwptGOt6QWmHgJL7sPIz H6JZwWoyb7uinQrZSVYw0NXeGqrMACN2JnJ32EZg6XV1sQLBS9K0tOMg3ChjryYOtU3l y/LdwiNnUMNkSEuw9q1o1DGN78FW2/CIN9QN0DXzyp0B2bkZUpbZTcyqQqTgER4tNfFw HzzAkg1reo3bYiEm6NBdOXPg70D+ujE6G2XXECYRKsu8C1CrB5H+9JaUgOvQomUM3qBs x4rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs.org header.s=201707 header.b=DFfOrXRu; 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=ozlabs.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f26-20020a05640214da00b0051825efb3eesi5832667edx.183.2023.06.13.21.36.32; Tue, 13 Jun 2023 21:36:59 -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=@ozlabs.org header.s=201707 header.b=DFfOrXRu; 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=ozlabs.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241554AbjFNEKR (ORCPT + 99 others); Wed, 14 Jun 2023 00:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242308AbjFNEKN (ORCPT ); Wed, 14 Jun 2023 00:10:13 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 268BF19B7 for ; Tue, 13 Jun 2023 21:10:11 -0700 (PDT) Received: by gandalf.ozlabs.org (Postfix, from userid 1003) id 4QgsQT3Xndz4x4G; Wed, 14 Jun 2023 14:10:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs.org; s=201707; t=1686715809; bh=wvvRc9qy6Ni7t/b7z+9GETWf6P/wewVtlrltmdxCvjw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DFfOrXRu+Zyg3+Fad0QP8M1k5KhwxTXq8rYTpjt/ZqPs1emMh/0XpTc9GFfMQTXpC x1Tg15tU6Ag18OQXH0RWERG/mlTQZwCdy/qgcFkoETTyIz015+f4eMr4vsq2rOrt7N qkAEVOn27CnNPfU9vby0DDO2A5+XP00l9JqBzdCOz2nygF0MTFJ43y8nxi2nkXHraF /7v6wQr2btfPPr6FGm0M3oBIfqVgehn3CxNCfHugZuUnu3ApTGMxmJ68Hd6fuWQGPf FeZEJDiMEvlv1oCGlooxUfOdEz9qIchWVxiOeCulNIJYhnrHxW7AJgK/nx8h55syBh QRRhLB5gU9FJg== Date: Wed, 14 Jun 2023 14:10:05 +1000 From: Paul Mackerras To: baomingtong001@208suo.com Cc: mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, pbonzini@redhat.com, seanjc@google.com, thuth@redhat.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: PPC: remove unneeded variable Message-ID: References: <20230614023206.3865-1-luojianhong@cdjrlc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed, Jun 14, 2023 at 10:34:45AM +0800, baomingtong001@208suo.com wrote: > fix the following coccicheck warning: > > arch/powerpc/kvm/book3s_pr.c:424:5-6: Unneeded variable: "r". > > Signed-off-by: Mingtong Bao > --- > arch/powerpc/kvm/book3s_pr.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c > index 9118242063fb..d03b31b240d7 100644 > --- a/arch/powerpc/kvm/book3s_pr.c > +++ b/arch/powerpc/kvm/book3s_pr.c > @@ -421,14 +421,14 @@ void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu) > > static int kvmppc_core_check_requests_pr(struct kvm_vcpu *vcpu) > { > - int r = 1; /* Indicate we want to get back into the guest */ > + /* Indicate we want to get back into the guest */ Instead of leaving the comment here, where it makes no sense, please move it to the return statement below. > > /* We misuse TLB_FLUSH to indicate that we want to clear > all shadow cache entries */ > if (kvm_check_request(KVM_REQ_TLB_FLUSH, vcpu)) > kvmppc_mmu_pte_flush(vcpu, 0, 0); > > - return r; > + return 1; > } > > /************* MMU Notifiers *************/ Paul.