Message ID | 20200702134650.16550-5-nborisov@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | A bunch of misc cleanups | expand |
On Thu, Jul 02, 2020 at 04:46:44PM +0300, Nikolay Borisov wrote: > Signed-off-by: Nikolay Borisov <nborisov@suse.com> > --- > fs/btrfs/raid56.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c > index a7ae4d8a47ce..d9415a22617b 100644 > --- a/fs/btrfs/raid56.c > +++ b/fs/btrfs/raid56.c > @@ -2093,7 +2093,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) > */ > if (atomic_read(&rbio->error) <= rbio->bbio->max_errors) { > __raid_recover_end_io(rbio); > - goto out; > + return 0; No please, when there are labels that do cleanup like the one in the context, 'return's make it harder to follow. > } else { > goto cleanup; > } > @@ -2113,7 +2113,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) > > submit_bio(bio); > } > -out: > + > return 0; > > cleanup: > -- > 2.17.1
On 2.07.20 г. 17:02 ч., David Sterba wrote: > On Thu, Jul 02, 2020 at 04:46:44PM +0300, Nikolay Borisov wrote: >> Signed-off-by: Nikolay Borisov <nborisov@suse.com> >> --- >> fs/btrfs/raid56.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c >> index a7ae4d8a47ce..d9415a22617b 100644 >> --- a/fs/btrfs/raid56.c >> +++ b/fs/btrfs/raid56.c >> @@ -2093,7 +2093,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) >> */ >> if (atomic_read(&rbio->error) <= rbio->bbio->max_errors) { >> __raid_recover_end_io(rbio); >> - goto out; >> + return 0; > > No please, when there are labels that do cleanup like the one in the > context, 'return's make it harder to follow. > But I'm not touching the cleanup hand of the if, rather the one which simply returns 0. SO why jmp + ret when we can straight ret ? >> } else { >> goto cleanup; >> } >> @@ -2113,7 +2113,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) >> >> submit_bio(bio); >> } >> -out: >> + >> return 0; >> >> cleanup: >> -- >> 2.17.1 >
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index a7ae4d8a47ce..d9415a22617b 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -2093,7 +2093,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) */ if (atomic_read(&rbio->error) <= rbio->bbio->max_errors) { __raid_recover_end_io(rbio); - goto out; + return 0; } else { goto cleanup; } @@ -2113,7 +2113,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) submit_bio(bio); } -out: + return 0; cleanup:
Signed-off-by: Nikolay Borisov <nborisov@suse.com> --- fs/btrfs/raid56.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)