diff options
author | Kari Argillander <kari.argillander@gmail.com> | 2021-09-07 16:28:42 +0200 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2021-09-16 16:01:37 +0200 |
commit | 6e3331ee34461be37f50912295a2e924a673dbc6 (patch) | |
tree | 4e38e7bbcf3cd099ebdfb6b1e546c82f9eeef6b9 /fs/ntfs3/fsntfs.c | |
parent | fs/ntfs3: Use clamp/max macros instead of comparisons (diff) | |
download | linux-6e3331ee34461be37f50912295a2e924a673dbc6.tar.xz linux-6e3331ee34461be37f50912295a2e924a673dbc6.zip |
fs/ntfs3: Use min/max macros instated of ternary operators
We can make code little bit more readable by using min/max macros.
These were found with Coccinelle.
Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to '')
-rw-r--r-- | fs/ntfs3/fsntfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index c964d3996aab..77d2e56d5b4f 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -382,7 +382,7 @@ int ntfs_look_for_free_space(struct ntfs_sb_info *sbi, CLST lcn, CLST len, } lcn = wnd_zone_bit(wnd); - alen = zlen > len ? len : zlen; + alen = min_t(CLST, len, zlen); wnd_zone_set(wnd, lcn + alen, zlen - alen); @@ -1096,7 +1096,7 @@ int ntfs_sb_write_run(struct ntfs_sb_info *sbi, const struct runs_tree *run, len = ((u64)clen << cluster_bits) - off; for (;;) { - u32 op = len < bytes ? len : bytes; + u32 op = min_t(u64, len, bytes); int err = ntfs_sb_write(sb, lbo, op, buf, 0); if (err) @@ -1297,7 +1297,7 @@ int ntfs_get_bh(struct ntfs_sb_info *sbi, const struct runs_tree *run, u64 vbo, nb->off = off = lbo & (blocksize - 1); for (;;) { - u32 len32 = len < bytes ? len : bytes; + u32 len32 = min_t(u64, len, bytes); sector_t block = lbo >> sb->s_blocksize_bits; do { |