Skip to contentSkip to conversation

f2fs: replace ternary operator with max()

PATCH In review [email protected] 2 participants 2 messages Oct 29, 2022 – Nov 1, 2022 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: replace ternary operator with max()

Fix the following coccicheck warning:

./fs/f2fs/segment.c:877:24-25: WARNING opportunity for max()

---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.c +1 -1
index ada21e83d279..6da92518328c 100644
@@ -874,7 +874,7 @@ block_t f2fs_get_unusable_blocks(struct f2fs_sb_info *sbi)
 	}
 	mutex_unlock(&dirty_i->seglist_lock);
 
-	unusable = holes[DATA] > holes[NODE] ? holes[DATA] : holes[NODE];
+	unusable = max(holes[DATA], holes[NODE]);
 	if (unusable > ovp_holes)
 		return unusable - ovp_holes;
 	return 0;
Signature · 1 line
2.25.1