Skip to content

Commit

Permalink
ext4: replace the traditional ternary conditional operator with with …
Browse files Browse the repository at this point in the history
…max()/min()

[ Upstream commit de8bf0e ]

Replace the traditional ternary conditional operator with with max()/min()

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20230801143204.2284343-7-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Stable-dep-of: 45e4ab3 ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Kemeng Shi authored and gregkh committed Oct 6, 2023
1 parent 39c4a95 commit 1e3c25d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6430,8 +6430,7 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
void *bitmap;

bitmap = e4b->bd_bitmap;
start = (e4b->bd_info->bb_first_free > start) ?
e4b->bd_info->bb_first_free : start;
start = max(e4b->bd_info->bb_first_free, start);
count = 0;
free_count = 0;

Expand Down Expand Up @@ -6648,8 +6647,7 @@ ext4_mballoc_query_range(

ext4_lock_group(sb, group);

start = (e4b.bd_info->bb_first_free > start) ?
e4b.bd_info->bb_first_free : start;
start = max(e4b.bd_info->bb_first_free, start);
if (end >= EXT4_CLUSTERS_PER_GROUP(sb))
end = EXT4_CLUSTERS_PER_GROUP(sb) - 1;

Expand Down

0 comments on commit 1e3c25d

Please sign in to comment.