Btrfs: code cleanup min/max -> min_t/max_t
PATCH 4/4 Btrfs: code cleanup min/max -> min_t/max_t
This cleans up the cases where the min/max macros were used with a cast rather than using directly min_t/max_t.
Signed-off-by Seraphime Kirkovski <[email protected]>
--- fs/btrfs/file-item.c | 4 ++-- fs/btrfs/ioctl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
fs/btrfs/file-item.c +2 -2
@@ -867,8 +867,8 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, tmp =min (tmp, (next_offset - file_key.offset) >> root->fs_info->sb->s_blocksize_bits); - tmp =max ((u64 )1 , tmp); - tmp =min (tmp, (u64 )MAX_CSUM_ITEMS (root, csum_size)); + tmp =max_t (u64,1 , tmp); + tmp =min_t (u64, tmp,MAX_CSUM_ITEMS (root, csum_size)); ins_size = csum_size * tmp; }else { ins_size = csum_size;
fs/btrfs/ioctl.c +1 -1
@@ -394,7 +394,7 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg) q =bdev_get_queue (device->bdev);if (blk_queue_discard (q)) { num_devices++; - minlen =min ((u64 )q->limits.discard_granularity, + minlen =min_t (u64, q->limits.discard_granularity, minlen); } }
Signature · 1 line
2.10.2
Quoted 4 lines · Seraphime Kirkovski
This cleans up the cases where the min/max macros were used with a cast rather than using directly min_t/max_t.
Signed-off-by Seraphime Kirkovski <[email protected]>
Reviewed-by David Sterba <[email protected]>
Added to cleanups branch, thanks.