Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 767a50be authored by Kemeng Shi's avatar Kemeng Shi Committed by Greg Kroah-Hartman
Browse files

ext4: replace the traditional ternary conditional operator with with max()/min()



[ Upstream commit de8bf0e5ee7482585450357c6d4eddec8efc5cb7 ]

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

Signed-off-by: default avatarKemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20230801143204.2284343-7-shikemeng@huaweicloud.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2fd502f5
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -5202,8 +5202,7 @@ static int ext4_try_to_trim_range(struct super_block *sb,
	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;

@@ -5423,8 +5422,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;