btrfs: replace nested usage of min & max with clamp in btrfs_compress_set_level()
Refactor the btrfs_compress_set_level() function by replacing the nested usage of min() and max() macro with clamp() to simplify the code and improve readability. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: George Hu <integral@archlinux.org> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -975,7 +975,7 @@ static int btrfs_compress_set_level(unsigned int type, int level)
|
||||
if (level == 0)
|
||||
level = ops->default_level;
|
||||
else
|
||||
level = min(max(level, ops->min_level), ops->max_level);
|
||||
level = clamp(level, ops->min_level, ops->max_level);
|
||||
|
||||
return level;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user