Skip to contentSkip to conversation

sysv: delete unnecessary checks before brelse()

PATCH New [email protected] 1 participant 1 message Aug 19, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysv: delete unnecessary checks before brelse()

From: Minghao Chi <[email protected]>

The brelse() function tests whether its argument is NULL and then returns immediately.
Thus remove the tests which are not needed around the shown calls.

---
 fs/sysv/balloc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
fs/sysv/balloc.c +3 -6
index 0e69dbdf7277..dd7fdc728ba7 100644
@@ -195,8 +195,7 @@ unsigned long sysv_count_free_blocks(struct super_block * sb)
 			break;
 
 		block = fs32_to_cpu(sbi, zone);
-		if (bh)
-			brelse(bh);
+		brelse(bh);
 
 		if (block < sbi->s_firstdatazone || block >= sbi->s_nzones)
 			goto Einval;
@@ -207,8 +206,7 @@ unsigned long sysv_count_free_blocks(struct super_block * sb)
 		n = fs16_to_cpu(sbi, *(__fs16*)bh->b_data);
 		blocks = get_chunk(sb, bh);
 	}
-	if (bh)
-		brelse(bh);
+	brelse(bh);
 	if (count != sb_count)
 		goto Ecount;
 done:
@@ -224,8 +222,7 @@ unsigned long sysv_count_free_blocks(struct super_block * sb)
 	goto trust_sb;
 E2big:
 	printk("sysv_count_free_blocks: >flc_size entries in free-list block\n");
-	if (bh)
-		brelse(bh);
+	brelse(bh);
 trust_sb:
 	count = sb_count;
 	goto done;
Signature · 1 line
2.25.1