Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp373130imw; Tue, 12 Jul 2022 22:58:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tYEN44Ng1V/BuRRKBukpXcy58l2Z1jD+6lIKwIxeaFOBK80uKEA/jzvdKcEW8Ua1OAEJ9T X-Received: by 2002:a17:907:720a:b0:72b:549e:305a with SMTP id dr10-20020a170907720a00b0072b549e305amr1619847ejc.691.1657691919337; Tue, 12 Jul 2022 22:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657691917; cv=none; d=google.com; s=arc-20160816; b=SxdiHsPVnuTt7d74i2OsbXMtMYHd7CEYbaV8pbEk3HusDaO58BbaTgx3NLiwZDR+kW lDdKU3QRZxFLFBmJVDhkPF8URyErNbD/EL2coqbe5P8tWq0WUd/Y5wGE19lyZBUEV9+o lL17qh3qPEqchMIZ8lc926alb2c2nPhYxOShZs+KjmKw4RXVpBuLHZVD24iMZ4aeCue+ gfxKf5+Xd7Ksm3fDY00INrvMc9A1c6nnmYmZRMzZ97SmUJgeM7dKnu0+ueyT/o0KylDk M0JtvlyV2colu/wMno1aTDQwlx1ofyDgRTIHHsZdHGQMeOGRLTxkVv0yXkraN5Zg74UB 4O2A== 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=SNQ0LgwraqgFyXlNdiOVPeWpyA9u+bOyeDOjAW5eixk=; b=xdEYRl3Q9+I6vZphRSQbvkaWkbUhlY4qyAYYRXayfNTJqCn2SVN7PuPPDn9/r2E8Yh gcQ+Bw4mflthWp2WKvaQdcpMbBH7C0qb9i5W+rtpxfCbW+senQNFVoxKiF0zLWuRApd7 0x5JqNipS6dUFfCfZSFrgoE6vgKKJqeYHjQsvc8Q48pkXoX7IM5ZYXUYQ7f5oPG9GLJi QzPQRhaEh2pLCTm1cXDFNOqB8R2KIasOTUI66kVkYl+Hbidf4hK5Nr63+ypSn0irWao2 G3y9kcYSuz2PELkTuNOVfKOfjTHgs05P9f9ekaxORqdty3iklbkSvDaTaR5i7dbPfUP4 XCvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d2u0wbYj; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a056402440800b004356ae0bc86si21027626eda.396.2022.07.12.22.58.12; Tue, 12 Jul 2022 22:58:37 -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=@kernel.org header.s=k20201202 header.b=d2u0wbYj; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234156AbiGMFvR (ORCPT + 99 others); Wed, 13 Jul 2022 01:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234064AbiGMFvO (ORCPT ); Wed, 13 Jul 2022 01:51:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36ABDB8532; Tue, 12 Jul 2022 22:51:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DD060B81C13; Wed, 13 Jul 2022 05:51:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81AC8C3411E; Wed, 13 Jul 2022 05:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657691470; bh=KaIT3yMJfV6LR7svBRIQX1mSKYbyUoI6s7ErAlCEusg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d2u0wbYjvehRU2pTFGL9aOX1/gIFykhoV8lAAKvisgaM/DiX6FffVIpzIc+Tvw6kp TTouyHpNcbOBn3o4fZ2nMfDQmcZIb1bzih/+xt8+WgTQcqHJ9KxHpb4GqvB7fmUEeN Ty/CcWn3uBIn/k4Nl1Gx7lW9kZkTa0j+6nrK4qKktYlKtxDAIn3D+qIqp43FJUezB1 YD8AWQlAUziv9Tvgp3vXD+G/WICoUeGo26coK6uu9JwgTcvuXYI0EyDoE+Tv0HWWLU aQaig90dPDhSYdxOzoXfJY/+8RxEFCQhTuwJxt4LqohyIjfYEO/rymjFwurb/9BxRv 9xMzrkphhEI+g== Date: Tue, 12 Jul 2022 22:51:09 -0700 From: "Darrick J. Wong" To: sunliming Cc: hch@lst.de, dchinner@redhat.com, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, kelulanainsley@gmail.com, kernel test robot Subject: Re: [PATCH RESEND] xfs: fix for variable set but not used warning Message-ID: References: <20220713014300.5108-1-sunliming@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220713014300.5108-1-sunliming@kylinos.cn> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 Wed, Jul 13, 2022 at 09:43:00AM +0800, sunliming wrote: > Fix below kernel warning: > > fs/xfs/scrub/repair.c:539:19: warning: variable 'agno' set but not used [-Wunused-but-set-variable] > > Reported-by: kernel test robot > Signed-off-by: sunliming > --- > fs/xfs/scrub/repair.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c > index a02ec8fbc8ac..032de115e373 100644 > --- a/fs/xfs/scrub/repair.c > +++ b/fs/xfs/scrub/repair.c > @@ -533,14 +533,12 @@ xrep_reap_block( > { > struct xfs_btree_cur *cur; > struct xfs_buf *agf_bp = NULL; > - xfs_agnumber_t agno; > xfs_agblock_t agbno; > bool has_other_rmap; > int error; > > - agno = XFS_FSB_TO_AGNO(sc->mp, fsbno); > agbno = XFS_FSB_TO_AGBNO(sc->mp, fsbno); > - ASSERT(agno == sc->sa.pag->pag_agno); > + ASSERT(XFS_FSB_TO_AGNO(sc->mp, fsbno) == sc->sa.pag->pag_agno); Much better, thank you. Reviewed-by: Darrick J. Wong --D > > /* > * If we are repairing per-inode metadata, we need to read in the AGF > -- > 2.25.1 >