Skip to content

Commit 2a09b57

Browse files
Changcheng DengDarrick J. Wong
authored andcommitted
xfs: use swap() to make code cleaner
Use swap() in order to make code cleaner. Issue found by coccinelle. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Changcheng Deng <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 0b9007e commit 2a09b57

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

fs/xfs/xfs_inode.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,6 @@ xfs_lock_two_inodes(
564564
struct xfs_inode *ip1,
565565
uint ip1_mode)
566566
{
567-
struct xfs_inode *temp;
568-
uint mode_temp;
569567
int attempts = 0;
570568
struct xfs_log_item *lp;
571569

@@ -578,12 +576,8 @@ xfs_lock_two_inodes(
578576
ASSERT(ip0->i_ino != ip1->i_ino);
579577

580578
if (ip0->i_ino > ip1->i_ino) {
581-
temp = ip0;
582-
ip0 = ip1;
583-
ip1 = temp;
584-
mode_temp = ip0_mode;
585-
ip0_mode = ip1_mode;
586-
ip1_mode = mode_temp;
579+
swap(ip0, ip1);
580+
swap(ip0_mode, ip1_mode);
587581
}
588582

589583
again:

0 commit comments

Comments
 (0)