Skip to content
Commit 66267814 authored by Jiangshan Yi's avatar Jiangshan Yi Committed by Theodore Ts'o
Browse files

fs/ext4: replace ternary operator with min()/max() and min_t()



Fix the following coccicheck warning:

fs/ext4/inline.c:183: WARNING opportunity for min().
fs/ext4/extents.c:2631: WARNING opportunity for max().
fs/ext4/extents.c:2632: WARNING opportunity for min().
fs/ext4/extents.c:5559: WARNING opportunity for max().
fs/ext4/super.c:6908: WARNING opportunity for min().

min()/max() and min_t() macro is defined in include/linux/minmax.h.
It avoids multiple evaluations of the arguments when non-constant and
performs strict type-checking.

Reported-by: default avatarkernel test robot <lkp@intel.com>
Suggested-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatarJiangshan Yi <yijiangshan@kylinos.cn>
Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
Link: https://lore.kernel.org/r/20220817025928.612851-1-13667453960@163.com
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 318cdc82
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment