* [PATCH][next] bcachefs: remove redundant assignment to variable ret
@ 2024-02-21 11:52 Colin Ian King
2024-02-21 13:37 ` Brian Foster
2024-02-22 0:04 ` Kent Overstreet
0 siblings, 2 replies; 7+ messages in thread
From: Colin Ian King @ 2024-02-21 11:52 UTC (permalink / raw)
To: Kent Overstreet, Brian Foster, linux-bcachefs
Cc: kernel-janitors, linux-kernel
Variable ret is being assigned a value that is never read, it is
being re-assigned a couple of statements later on. The assignment
is redundant and can be removed.
Cleans up clang scan build warning:
fs/bcachefs/super-io.c:806:2: warning: Value stored to 'ret' is
never read [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/bcachefs/super-io.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
index 110dcb0337ce..c6d590404425 100644
--- a/fs/bcachefs/super-io.c
+++ b/fs/bcachefs/super-io.c
@@ -804,7 +804,6 @@ static int __bch2_read_super(const char *path, struct bch_opts *opts,
goto err;
}
- ret = 0;
sb->have_layout = true;
ret = bch2_sb_validate(sb, &err, READ);
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH][next] bcachefs: remove redundant assignment to variable ret
2024-02-21 11:52 [PATCH][next] bcachefs: remove redundant assignment to variable ret Colin Ian King
@ 2024-02-21 13:37 ` Brian Foster
2024-02-22 0:04 ` Kent Overstreet
1 sibling, 0 replies; 7+ messages in thread
From: Brian Foster @ 2024-02-21 13:37 UTC (permalink / raw)
To: Colin Ian King
Cc: Kent Overstreet, linux-bcachefs, kernel-janitors, linux-kernel
On Wed, Feb 21, 2024 at 11:52:03AM +0000, Colin Ian King wrote:
> Variable ret is being assigned a value that is never read, it is
> being re-assigned a couple of statements later on. The assignment
> is redundant and can be removed.
>
> Cleans up clang scan build warning:
> fs/bcachefs/super-io.c:806:2: warning: Value stored to 'ret' is
> never read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/bcachefs/super-io.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
> index 110dcb0337ce..c6d590404425 100644
> --- a/fs/bcachefs/super-io.c
> +++ b/fs/bcachefs/super-io.c
> @@ -804,7 +804,6 @@ static int __bch2_read_super(const char *path, struct bch_opts *opts,
> goto err;
> }
>
> - ret = 0;
> sb->have_layout = true;
>
> ret = bch2_sb_validate(sb, &err, READ);
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][next] bcachefs: remove redundant assignment to variable ret
2024-02-21 11:52 [PATCH][next] bcachefs: remove redundant assignment to variable ret Colin Ian King
2024-02-21 13:37 ` Brian Foster
@ 2024-02-22 0:04 ` Kent Overstreet
2024-02-22 0:08 ` Colin King (gmail)
1 sibling, 1 reply; 7+ messages in thread
From: Kent Overstreet @ 2024-02-22 0:04 UTC (permalink / raw)
To: Colin Ian King
Cc: Brian Foster, linux-bcachefs, kernel-janitors, linux-kernel
On Wed, Feb 21, 2024 at 11:52:03AM +0000, Colin Ian King wrote:
> Variable ret is being assigned a value that is never read, it is
> being re-assigned a couple of statements later on. The assignment
> is redundant and can be removed.
>
> Cleans up clang scan build warning:
> fs/bcachefs/super-io.c:806:2: warning: Value stored to 'ret' is
> never read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
I'll take this, but - entirely too much of the traffic on this list is
getting taken up by static analyzer bullshit, we need to cut down on
this
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][next] bcachefs: remove redundant assignment to variable ret
2024-02-22 0:04 ` Kent Overstreet
@ 2024-02-22 0:08 ` Colin King (gmail)
2024-02-22 0:13 ` Kent Overstreet
0 siblings, 1 reply; 7+ messages in thread
From: Colin King (gmail) @ 2024-02-22 0:08 UTC (permalink / raw)
To: Kent Overstreet
Cc: Brian Foster, linux-bcachefs, kernel-janitors, linux-kernel
On 22/02/2024 00:04, Kent Overstreet wrote:
> On Wed, Feb 21, 2024 at 11:52:03AM +0000, Colin Ian King wrote:
>> Variable ret is being assigned a value that is never read, it is
>> being re-assigned a couple of statements later on. The assignment
>> is redundant and can be removed.
>>
>> Cleans up clang scan build warning:
>> fs/bcachefs/super-io.c:806:2: warning: Value stored to 'ret' is
>> never read [deadcode.DeadStores]
>>
>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>
> I'll take this, but - entirely too much of the traffic on this list is
> getting taken up by static analyzer bullshit, we need to cut down on
> this
I'll back off then.
Colin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][next] bcachefs: remove redundant assignment to variable ret
2024-02-22 0:08 ` Colin King (gmail)
@ 2024-02-22 0:13 ` Kent Overstreet
2024-02-22 5:24 ` Dan Carpenter
0 siblings, 1 reply; 7+ messages in thread
From: Kent Overstreet @ 2024-02-22 0:13 UTC (permalink / raw)
To: Colin King (gmail)
Cc: Brian Foster, linux-bcachefs, kernel-janitors, linux-kernel
On Thu, Feb 22, 2024 at 12:08:28AM +0000, Colin King (gmail) wrote:
> On 22/02/2024 00:04, Kent Overstreet wrote:
> > On Wed, Feb 21, 2024 at 11:52:03AM +0000, Colin Ian King wrote:
> > > Variable ret is being assigned a value that is never read, it is
> > > being re-assigned a couple of statements later on. The assignment
> > > is redundant and can be removed.
> > >
> > > Cleans up clang scan build warning:
> > > fs/bcachefs/super-io.c:806:2: warning: Value stored to 'ret' is
> > > never read [deadcode.DeadStores]
> > >
> > > Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> >
> > I'll take this, but - entirely too much of the traffic on this list is
> > getting taken up by static analyzer bullshit, we need to cut down on
> > this
>
> I'll back off then.
Maybe just wrap up fixes for all the warnings every now and then? It is
worth keeping up on static analyzer warnings, it's just the mailing list
noise I want to cut down on, as well as making better use of my own
time.
I'd be happy to take a patch like that now and then, or - maybe we could
get a dashboard going, like I was just running by Dan in the other
thread? If we could get a dirt simple stupid dashboard that had both the
clangc analyzer warnings, and the smatch warnings - I think that would
make a lot of people happy.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][next] bcachefs: remove redundant assignment to variable ret
2024-02-22 0:13 ` Kent Overstreet
@ 2024-02-22 5:24 ` Dan Carpenter
2024-02-22 6:37 ` Kent Overstreet
0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2024-02-22 5:24 UTC (permalink / raw)
To: Kent Overstreet
Cc: Colin King (gmail), Brian Foster, linux-bcachefs, kernel-janitors,
linux-kernel
To be honest, the point of explaining how to run Smatch was really to
let you know that you're now on your own.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][next] bcachefs: remove redundant assignment to variable ret
2024-02-22 5:24 ` Dan Carpenter
@ 2024-02-22 6:37 ` Kent Overstreet
0 siblings, 0 replies; 7+ messages in thread
From: Kent Overstreet @ 2024-02-22 6:37 UTC (permalink / raw)
To: Dan Carpenter
Cc: Colin King (gmail), Brian Foster, linux-bcachefs, kernel-janitors,
linux-kernel
On Thu, Feb 22, 2024 at 08:24:58AM +0300, Dan Carpenter wrote:
> To be honest, the point of explaining how to run Smatch was really to
> let you know that you're now on your own.
Ok that's fine - in that case, I just need to ask you to stop bugging me
to get me to explain smatch bugs to you.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-02-22 6:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-21 11:52 [PATCH][next] bcachefs: remove redundant assignment to variable ret Colin Ian King
2024-02-21 13:37 ` Brian Foster
2024-02-22 0:04 ` Kent Overstreet
2024-02-22 0:08 ` Colin King (gmail)
2024-02-22 0:13 ` Kent Overstreet
2024-02-22 5:24 ` Dan Carpenter
2024-02-22 6:37 ` Kent Overstreet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox