From: Nathan Chancellor <nathan@kernel.org>
To: Tom Rix <trix@redhat.com>
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
ndesaulniers@google.com, linux-btrfs@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] btrfs: remove unused variable pages_processed
Date: Thu, 1 Jun 2023 11:29:57 -0700 [thread overview]
Message-ID: <20230601182957.GA3028824@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230530142154.3341677-1-trix@redhat.com>
On Tue, May 30, 2023 at 10:21:54AM -0400, Tom Rix wrote:
> clang with W=1 reports
> fs/btrfs/extent_io.c:230:16: error: variable
> 'pages_processed' set but not used [-Werror,-Wunused-but-set-variable]
> unsigned long pages_processed = 0;
> ^
> This variable is not used so remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
Caused by commit 6d6a31e7fc99 ("btrfs: split page locking out of
__process_pages_contig").
It is worth noting that while -Wunused-but-set-variable is normally
under W=1, btrfs explicitly enables it in their Makefile, so this
warning is visible during a normal build, which breaks the build with
CONFIG_WERROR.
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> fs/btrfs/extent_io.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 89e093ae1c33..6919409c1183 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -227,7 +227,6 @@ static void __process_pages_contig(struct address_space *mapping,
> pgoff_t start_index = start >> PAGE_SHIFT;
> pgoff_t end_index = end >> PAGE_SHIFT;
> pgoff_t index = start_index;
> - unsigned long pages_processed = 0;
> struct folio_batch fbatch;
> int i;
>
> @@ -242,7 +241,6 @@ static void __process_pages_contig(struct address_space *mapping,
>
> process_one_page(fs_info, &folio->page, locked_page,
> page_ops, start, end);
> - pages_processed += folio_nr_pages(folio);
> }
> folio_batch_release(&fbatch);
> cond_resched();
> --
> 2.27.0
>
prev parent reply other threads:[~2023-06-01 18:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 14:21 [PATCH] btrfs: remove unused variable pages_processed Tom Rix
2023-06-01 18:29 ` Nathan Chancellor [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=20230601182957.GA3028824@dev-arch.thelio-3990X \
--to=nathan@kernel.org \
--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=ndesaulniers@google.com \
--cc=trix@redhat.com \
/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