diff options
author | Jiangshan Yi <yijiangshan@kylinos.cn> | 2022-08-19 10:52:40 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2022-08-19 12:06:08 +0300 |
commit | e03d3b1b924cbaac91ddf066e4d14a2c4d3ed1d1 (patch) | |
tree | 31d17df76d9b97e1291635ad05b62f28047d3d99 /fs/reiserfs/prints.c | |
parent | 4c2d0b039c5cc0112206a5b22431b577cb1c57ad (diff) | |
download | linux-e03d3b1b924cbaac91ddf066e4d14a2c4d3ed1d1.tar.xz |
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/prints.c')
-rw-r--r-- | fs/reiserfs/prints.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c index 30319dc33c18..84a194b77f19 100644 --- a/fs/reiserfs/prints.c +++ b/fs/reiserfs/prints.c @@ -456,7 +456,7 @@ static int print_internal(struct buffer_head *bh, int first, int last) to = B_NR_ITEMS(bh); } else { from = first; - to = last < B_NR_ITEMS(bh) ? last : B_NR_ITEMS(bh); + to = min_t(int, last, B_NR_ITEMS(bh)); } reiserfs_printk("INTERNAL NODE (%ld) contains %z\n", bh->b_blocknr, bh); |