Btrfs: code cleanup min/max -> min_t/max_t
authorSeraphime Kirkovski <kirkseraph@gmail.com>
Thu, 15 Dec 2016 13:38:28 +0000 (14:38 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Feb 2017 14:50:50 +0000 (15:50 +0100)
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 <kirkseraph@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c
fs/btrfs/ioctl.c

index e97e322..42a97c9 100644 (file)
@@ -856,8 +856,8 @@ insert:
                tmp = min(tmp, (next_offset - file_key.offset) >>
                                         fs_info->sb->s_blocksize_bits);
 
-               tmp = max((u64)1, tmp);
-               tmp = min(tmp, (u64)MAX_CSUM_ITEMS(fs_info, csum_size));
+               tmp = max_t(u64, 1, tmp);
+               tmp = min_t(u64, tmp, MAX_CSUM_ITEMS(fs_info, csum_size));
                ins_size = csum_size * tmp;
        } else {
                ins_size = csum_size;
index 21e51b0..03de93f 100644 (file)
@@ -395,7 +395,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);
                }
        }