diff options
author | Jiangshan Yi <yijiangshan@kylinos.cn> | 2022-08-19 09:52:40 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2022-08-19 11:06:08 +0200 |
commit | e03d3b1b924cbaac91ddf066e4d14a2c4d3ed1d1 (patch) | |
tree | 31d17df76d9b97e1291635ad05b62f28047d3d99 /fs/reiserfs/resize.c | |
parent | Merge tag 'net-6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff) | |
download | linux-e03d3b1b924cbaac91ddf066e4d14a2c4d3ed1d1.tar.xz linux-e03d3b1b924cbaac91ddf066e4d14a2c4d3ed1d1.zip |
fs/reiserfs: replace ternary operator with min() and min_t()
Fix the following coccicheck warning:
fs/reiserfs/prints.c:459: WARNING opportunity for min().
fs/reiserfs/resize.c:100: WARNING opportunity for min().
fs/reiserfs/super.c:2508: WARNING opportunity for min().
fs/reiserfs/super.c:2557: WARNING opportunity for min().
min() 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.
Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220819075240.3199477-1-13667453960@163.com
Diffstat (limited to 'fs/reiserfs/resize.c')
-rw-r--r-- | fs/reiserfs/resize.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c index 8096c74c38ac..7b498a0d060b 100644 --- a/fs/reiserfs/resize.c +++ b/fs/reiserfs/resize.c @@ -97,7 +97,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new) * using the copy_size var below allows this code to work for * both shrinking and expanding the FS. */ - copy_size = bmap_nr_new < bmap_nr ? bmap_nr_new : bmap_nr; + copy_size = min(bmap_nr_new, bmap_nr); copy_size = copy_size * sizeof(struct reiserfs_list_bitmap_node *); for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) { |