ext4: use swap macro in mext_page_double_lock
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Sun, 29 Jul 2018 20:11:59 +0000 (16:11 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 29 Jul 2018 20:11:59 +0000 (16:11 -0400)
Make use of the swap macro and remove unnecessary variable *tmp*.
This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/move_extent.c

index 8e17efdcbf118d7218f0f9e68633e5f6639aa582..a409ff70d67ba7dd13b8e1c55ac9d29987b91c76 100644 (file)
@@ -134,9 +134,7 @@ mext_page_double_lock(struct inode *inode1, struct inode *inode2,
                mapping[0] = inode1->i_mapping;
                mapping[1] = inode2->i_mapping;
        } else {
-               pgoff_t tmp = index1;
-               index1 = index2;
-               index2 = tmp;
+               swap(index1, index2);
                mapping[0] = inode2->i_mapping;
                mapping[1] = inode1->i_mapping;
        }