kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: scope ret locally in ext4_try_to_trim_range()
@ 2021-08-20 12:08 Lukas Bulwahn
  2021-10-28 14:59 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Bulwahn @ 2021-08-20 12:08 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, linux-ext4
  Cc: kernel-janitors, linux-kernel, Lukas Bulwahn

As commit 6920b3913235 ("ext4: add new helper interface
ext4_try_to_trim_range()") moves some code into the separate function
ext4_try_to_trim_range(), the use of the variable ret within that
function is more limited and can be adjusted as well.

Scope the use of the variable ret locally and drop dead assignments.

No functional change.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
 fs/ext4/mballoc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index e89db3396203..f4c0a37431cd 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -6301,7 +6301,6 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
 {
 	ext4_grpblk_t next, count, free_count;
 	void *bitmap;
-	int ret = 0;
 
 	bitmap = e4b->bd_bitmap;
 	start = (e4b->bd_info->bb_first_free > start) ?
@@ -6316,10 +6315,9 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
 		next = mb_find_next_bit(bitmap, max + 1, start);
 
 		if ((next - start) >= minblocks) {
-			ret = ext4_trim_extent(sb, start, next - start, e4b);
+			int ret = ext4_trim_extent(sb, start, next - start, e4b);
 			if (ret && ret != -EOPNOTSUPP)
 				break;
-			ret = 0;
 			count += next - start;
 		}
 		free_count += next - start;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: scope ret locally in ext4_try_to_trim_range()
  2021-08-20 12:08 [PATCH] ext4: scope ret locally in ext4_try_to_trim_range() Lukas Bulwahn
@ 2021-10-28 14:59 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2021-10-28 14:59 UTC (permalink / raw)
  To: Andreas Dilger, linux-ext4, Lukas Bulwahn
  Cc: Theodore Ts'o, linux-kernel, kernel-janitors

On Fri, 20 Aug 2021 14:08:53 +0200, Lukas Bulwahn wrote:
> As commit 6920b3913235 ("ext4: add new helper interface
> ext4_try_to_trim_range()") moves some code into the separate function
> ext4_try_to_trim_range(), the use of the variable ret within that
> function is more limited and can be adjusted as well.
> 
> Scope the use of the variable ret locally and drop dead assignments.
> 
> [...]

Applied, thanks!

[1/1] ext4: scope ret locally in ext4_try_to_trim_range()
      commit: fd7a2ed7b32a4ee41477a5326941b95650575c84

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-28 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 12:08 [PATCH] ext4: scope ret locally in ext4_try_to_trim_range() Lukas Bulwahn
2021-10-28 14:59 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).