fs/ext4: replace ternary operator with min()/max() and min_t()
[linux-2.6-microblaze.git] / fs / ext4 / extents.c
index 6c399a8..ec00827 100644 (file)
@@ -2635,9 +2635,8 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
                          unwritten, ex_ee_len);
                path[depth].p_ext = ex;
 
-               a = ex_ee_block > start ? ex_ee_block : start;
-               b = ex_ee_block+ex_ee_len - 1 < end ?
-                       ex_ee_block+ex_ee_len - 1 : end;
+               a = max(ex_ee_block, start);
+               b = min(ex_ee_block + ex_ee_len - 1, end);
 
                ext_debug(inode, "  border %u:%u\n", a, b);
 
@@ -5567,8 +5566,7 @@ static int ext4_insert_range(struct file *file, loff_t offset, loff_t len)
         * ee_start_lblk to shift extents
         */
        ret = ext4_ext_shift_extents(inode, handle,
-               ee_start_lblk > offset_lblk ? ee_start_lblk : offset_lblk,
-               len_lblk, SHIFT_RIGHT);
+               max(ee_start_lblk, offset_lblk), len_lblk, SHIFT_RIGHT);
 
        up_write(&EXT4_I(inode)->i_data_sem);
        if (IS_SYNC(inode))