Skip to contentSkip to conversation

ext4: scope ret locally in ext4_try_to_trim_range()

PATCH Applied Lukas Bulwahn 2 participants 2 messages Aug 20, 2021 – Oct 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: scope ret locally in ext4_try_to_trim_range()

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.

---
 fs/ext4/mballoc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ext4/mballoc.c +1 -3
index e89db3396203..f4c0a37431cd 100644
@@ -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;
Signature · 1 line
2.26.2
maintainer Applied
#1 lore raw
Quoted 8 lines · 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.

[...]

Applied, thanks!

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

      commit: fd7a2ed7b32a4ee41477a5326941b95650575c84

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>