From: David Sterba <dsterba@suse.cz>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, patches@lists.linux.dev,
stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: Remove unused variable in btrfs_{start,write}_dirty_block_groups()
Date: Thu, 24 Mar 2022 19:49:36 +0100 [thread overview]
Message-ID: <20220324184936.GL2237@suse.cz> (raw)
In-Reply-To: <20220324153644.4079376-1-nathan@kernel.org>
On Thu, Mar 24, 2022 at 08:36:45AM -0700, Nathan Chancellor wrote:
> 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 <nathan@kernel.org>
Added to misc-next, thanks.
> I am requesting a stable backport because this is visible with
> allmodconfig, which enables CONFIG_WERROR, breaking the build.
Yeah warning fixes are accepted in stable trees and we care about
warning-free builds. My gcc 11.1 does not produce any warning with
-Wunused-but-set-variable and we have extended the set of warnings in
the directory fs/btrfs/ that also includes that one.
> 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."
I have CONFIG_WERROR disabled, for own development it's quite annoying
when build fails outside of the code I care about, while I apply visual
checks of warning-free builds.
prev parent reply other threads:[~2022-03-24 18:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 15:36 [PATCH] btrfs: Remove unused variable in btrfs_{start,write}_dirty_block_groups() Nathan Chancellor
2022-03-24 18:49 ` David Sterba [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220324184936.GL2237@suse.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox