Skip to content

Commit

Permalink
xfs: use swap() to make code cleaner
Browse files Browse the repository at this point in the history
Use swap() in order to make code cleaner. Issue found by coccinelle.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
  • Loading branch information
Changcheng Deng authored and Darrick J. Wong committed Oct 30, 2021
1 parent 0b9007e commit 2a09b57
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,6 @@ xfs_lock_two_inodes(
struct xfs_inode *ip1,
uint ip1_mode)
{
struct xfs_inode *temp;
uint mode_temp;
int attempts = 0;
struct xfs_log_item *lp;

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

if (ip0->i_ino > ip1->i_ino) {
temp = ip0;
ip0 = ip1;
ip1 = temp;
mode_temp = ip0_mode;
ip0_mode = ip1_mode;
ip1_mode = mode_temp;
swap(ip0, ip1);
swap(ip0_mode, ip1_mode);
}

again:
Expand Down

0 comments on commit 2a09b57

Please sign in to comment.