From: wangkailong@jari.cn Date: Sat, 29 Oct 2022 14:49:30 +0000 (+0800) Subject: f2fs: replace ternary operator with max() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3b21b794b5797d35f4fad930b53b1cd881c12dd3;p=linux.git f2fs: replace ternary operator with max() Fix the following coccicheck warning: ./fs/f2fs/segment.c:877:24-25: WARNING opportunity for max() Signed-off-by: KaiLong Wang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index c4270cd6eaab7..aa4be7f25963d 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -856,7 +856,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;