Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2090041pxb; Fri, 25 Mar 2022 10:54:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAEK4ZfK5r5h8bs75eT5sbwf/QoBZ625mfD4SzzZejeTBJ5vt+Ub2+4kPttCg2dTjPEr8u X-Received: by 2002:a63:fe4a:0:b0:382:b4f:8353 with SMTP id x10-20020a63fe4a000000b003820b4f8353mr572269pgj.177.1648230890041; Fri, 25 Mar 2022 10:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648230890; cv=none; d=google.com; s=arc-20160816; b=0bPTyiLaXMgalL+zxJ4ERah8UlpPytTA2WfPktaSKEWx2HHNxQcCKoI/+qBRw8aE2W 3EQnlivoT6N2zPefFEa9BuObH5kPTXYK8S/QUehh7FqND+5tnJnoCFAqAY51y3+ixyyO 6bE8NMoK01vug1TaU0WSwpO6Cxb9xBuQkZkCJPR0l/SgvINpaMG4SwvQFTow7nKGn3WM ZtMpyGdf/X6X3G0pGg2O9faLgyzEFRTvlQSRtYBD/jYqYxCSR29ysCJDiFii0awsypMJ dUcEp6PE2MMfaURiZYAOHiNvYwGmAkAiqgkzLazHYCeLdcc2TgKv2OAh8xNQFozAjEC9 w31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=etjTp4weU2n4jD/CMiSGm11fYBH/61MRaLeUFz5UYsE=; b=BpPYGxruKGGHVFJ/jyoVq8iNQrR484X3MNI+hOcYiGT93wB8oaB5rQ7aa9t1vqOlWr FgqmLP6OCcdredm9CxCnVHuWJirl0BQadWcEK313Vesp6MVjyGq4aQsDeNJllwwSVo55 sn17KcwkUj2ZCHV/Cs1yIfgGBmXm4ZyjQg5yB0Ngd/7bdag8mNN4EjmPMGi/yNstDWYx hLIp/HIPMT0k9fOEBLh/IHMiM7MZOVpN/jItOaj3Nox224ph1qlCvcMOeS8jxcvVXshI DxmRy/WQXOCGEibbQH6gGGVyWXT7pl6u0GYLqKcqwgLNgnAT65Lo7sIUl69TI6ZU2nMT KjAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pkmMmzYn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h8-20020a63f908000000b003816cf17c43si3031543pgi.554.2022.03.25.10.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:54:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pkmMmzYn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9A491B6E64; Fri, 25 Mar 2022 10:34:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351323AbiCXPlb (ORCPT + 99 others); Thu, 24 Mar 2022 11:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243459AbiCXPla (ORCPT ); Thu, 24 Mar 2022 11:41:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5599198F46; Thu, 24 Mar 2022 08:39:58 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E1BFA61835; Thu, 24 Mar 2022 15:39:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5691C340EC; Thu, 24 Mar 2022 15:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648136397; bh=W2gwKBXTGnbi1TztKRUks+XIXhyWOZvvzMkuDRdIR+U=; h=From:To:Cc:Subject:Date:From; b=pkmMmzYnW3px4Ml8thL52AnBARS1xU5McoGTxS2ANE3DZgQouliDKdQGS6U5tf6F/ n8yoRpkGLCBZbo9C6ws1l7wSAbDIBY7kPWdN8LwTaNnqqcbEe2nbX+/lUWyLOx/q5D 9hpb7ScnOEf5oGfZMVkzQp6V2hJPx7E/6EdFMg5lIxJxtcf9G3TsKEWp+B46wCK9HX Lbpgfpf2i8qSkhgyI35ca1kMPn1OshG57j9G0tPisX0EreJPXMMmur/eCNZOSVaTfT gqc65f1xzzbmlB30wSjEDmiSP+UrQswqAuP2JX+B6iAl2eUJ+zwjHk29Rj92M19nlm g9AO4AjAhZxoA== From: Nathan Chancellor To: Chris Mason , Josef Bacik , David Sterba Cc: Nick Desaulniers , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor , stable@vger.kernel.org Subject: [PATCH] btrfs: Remove unused variable in btrfs_{start,write}_dirty_block_groups() Date: Thu, 24 Mar 2022 08:36:45 -0700 Message-Id: <20220324153644.4079376-1-nathan@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Clang's version of -Wunused-but-set-variable recently gained support for unary operations, which reveals two unused variables: fs/btrfs/block-group.c:2949:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] int num_started = 0; ^ fs/btrfs/block-group.c:3116:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] int num_started = 0; ^ 2 errors generated. These variables appear to be unused from their introduction, so just remove them to silence the warnings. Cc: stable@vger.kernel.org Fixes: c9dc4c657850 ("Btrfs: two stage dirty block group writeout") Fixes: 1bbc621ef284 ("Btrfs: allow block group cache writeout outside critical section in commit") Link: https://github.com/ClangBuiltLinux/linux/issues/1614 Signed-off-by: Nathan Chancellor --- I am requesting a stable backport because this is visible with allmodconfig, which enables CONFIG_WERROR, breaking the build. To quote Linus: "EVERYBODY should have CONFIG_WERROR=y on at least x86-64 and other serious architectures, unless you have some completely random experimental (and broken) compiler." https://lore.kernel.org/r/CAHk-=wifoM9VOp-55OZCRcO9MnqQ109UTuCiXeZ-eyX_JcNVGg@mail.gmail.com/ fs/btrfs/block-group.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index c22d287e020b..9ad265066225 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -2946,7 +2946,6 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans) struct btrfs_path *path = NULL; LIST_HEAD(dirty); struct list_head *io = &cur_trans->io_bgs; - int num_started = 0; int loops = 0; spin_lock(&cur_trans->dirty_bgs_lock); @@ -3012,7 +3011,6 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans) cache->io_ctl.inode = NULL; ret = btrfs_write_out_cache(trans, cache, path); if (ret == 0 && cache->io_ctl.inode) { - num_started++; should_put = 0; /* @@ -3113,7 +3111,6 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans) int should_put; struct btrfs_path *path; struct list_head *io = &cur_trans->io_bgs; - int num_started = 0; path = btrfs_alloc_path(); if (!path) @@ -3171,7 +3168,6 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans) cache->io_ctl.inode = NULL; ret = btrfs_write_out_cache(trans, cache, path); if (ret == 0 && cache->io_ctl.inode) { - num_started++; should_put = 0; list_add_tail(&cache->io_list, io); } else { base-commit: d3e29967079c522ce1c5cab0e9fab2c280b977eb -- 2.35.1