btrfs: Remove done label in writepage_delalloc
PATCH 1/1 btrfs: Remove done label in writepage_delalloc
Since there is not common cleanup run after the label it makes it somewhat redundant.
--- fs/btrfs/extent_io.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
fs/btrfs/extent_io.c +2 -6
@@ -3445,8 +3445,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,* started, so we don't want to return > 0 unless * things are going well. */ - ret = ret <0 ? ret : -EIO ; - goto done; +return ret <0 ? ret : -EIO ; }/* * delalloc_end is already one less than the total length, so
@@ -3478,10 +3477,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,return 1 ; } - ret =0 ; - -done: -return ret; +return 0 ; }/*
--
2.17.1
Quoted 23 lines · Nikolay Borisov
Since there is not common cleanup run after the label it makes it somewhat redundant.
Signed-off-by Nikolay Borisov <[email protected]>--- fs/btrfs/extent_io.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)fs/btrfs/extent_io.c +1
-2@@ -3445,8 +3445,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,* started, so we don't want to return > 0 unless * things are going well. */ - ret = ret <0 ? ret : -EIO ; - goto done; +return ret <0 ? ret : -EIO ; }/* * delalloc_end is already one less than the total length, so
fs/btrfs/extent_io.c static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode, · line 3481
Quoted 9 lines
fs/btrfs/extent_io.c +1
-4@@ -3478,10 +3477,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,return 1 ; } - ret =0 ; - -done: -return ret; +return 0 ; }
I thought David doesn't like direct returns in loops?
/me thinks this is easier to understand though
Quoted 36 lines · Johannes Thumshirn
Quoted 23 lines · Nikolay Borisov
Since there is not common cleanup run after the label it makes it somewhat redundant.
Signed-off-by Nikolay Borisov <[email protected]>--- fs/btrfs/extent_io.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)fs/btrfs/extent_io.c +1
-2@@ -3445,8 +3445,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,* started, so we don't want to return > 0 unless * things are going well. */ - ret = ret <0 ? ret : -EIO ; - goto done; +return ret <0 ? ret : -EIO ; }/* * delalloc_end is already one less than the total length, so fs/btrfs/extent_io.c static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode, · line 3481
Quoted 9 lines
fs/btrfs/extent_io.c +1
-4@@ -3478,10 +3477,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,return 1 ; } - ret =0 ; - -done: -return ret; +return 0 ; }I thought David doesn't like direct returns in loops?
Quoted 1 line
/me thinks this is easier to understand though
I don't but try to evaluate each patch if it makes sense and the code is readable and does not diverge too much from patterns we have elsewhere. This one looks ok, so I'll add it to misc-next.