public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>,
	linux-bcachefs@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5][next] bcachefs: remove redundant initialization of pointer dst
Date: Tue, 12 Sep 2023 09:52:15 -0400	[thread overview]
Message-ID: <ZQBtDxCcTGv/KAo0@bfoster> (raw)
In-Reply-To: <20230912123744.3929609-3-colin.i.king@gmail.com>

On Tue, Sep 12, 2023 at 01:37:41PM +0100, Colin Ian King wrote:
> The pointer dst is being initialized with a value that is never read,
> it is being re-assigned later on when it is used in a while-loop
> The initialization is redundant and can be removed.
> 
> Cleans up clang-scan build warning:
> fs/bcachefs/disk_groups.c:186:30: warning: Value stored to 'dst' during
> its initialization is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  fs/bcachefs/disk_groups.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/bcachefs/disk_groups.c b/fs/bcachefs/disk_groups.c
> index f36472c4a781..9fa8d7d49f3e 100644
> --- a/fs/bcachefs/disk_groups.c
> +++ b/fs/bcachefs/disk_groups.c
> @@ -183,8 +183,7 @@ int bch2_sb_disk_groups_to_cpu(struct bch_fs *c)
>  
>  	for (i = 0; i < c->disk_sb.sb->nr_devices; i++) {
>  		struct bch_member *m = mi->members + i;
> -		struct bch_disk_group_cpu *dst =
> -			&cpu_g->entries[BCH_MEMBER_GROUP(m)];
> +		struct bch_disk_group_cpu *dst;

Nit: kind of seems like this variable could just be lifted to the top of
the function given that it's used in two loops, but the patch seems fine
to me either way.

Brian

>  
>  		if (!bch2_member_exists(m))
>  			continue;
> -- 
> 2.39.2
> 


  reply	other threads:[~2023-09-12 13:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 12:37 [PATCH 0/5][next] bcachefs: clean up some redundant assignments Colin Ian King
2023-09-12 12:37 ` [PATCH 1/5][next] bcachefs: remove redundant initialization of pointer d Colin Ian King
2023-09-12 12:37 ` [PATCH 2/5][next] bcachefs: remove redundant initialization of pointer dst Colin Ian King
2023-09-12 13:52   ` Brian Foster [this message]
2023-09-12 12:37 ` [PATCH 3/5][next] bcachefs: remove redundant initializations of variables start_offset and end_offset Colin Ian King
2023-09-12 12:37 ` [PATCH 4/5][next] bcachefs: remove duplicated assignment to variable offset_into_extent Colin Ian King
2023-09-12 12:37 ` [PATCH 5/5][next] bcachefs: remove redundant pointer q Colin Ian King
2023-09-12 13:52 ` [PATCH 0/5][next] bcachefs: clean up some redundant assignments Brian Foster
2023-09-12 16:27 ` Kent Overstreet

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=ZQBtDxCcTGv/KAo0@bfoster \
    --to=bfoster@redhat.com \
    --cc=colin.i.king@gmail.com \
    --cc=kent.overstreet@linux.dev \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-kernel@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