提交 2a09b575 编写于 作者: C Changcheng Deng 提交者: Darrick J. Wong

xfs: use swap() to make code cleaner

Use swap() in order to make code cleaner. Issue found by coccinelle.
Reported-by: NZeal Robot <zealci@zte.com.cn>
Signed-off-by: NChangcheng Deng <deng.changcheng@zte.com.cn>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
上级 0b9007ec
...@@ -564,8 +564,6 @@ xfs_lock_two_inodes( ...@@ -564,8 +564,6 @@ xfs_lock_two_inodes(
struct xfs_inode *ip1, struct xfs_inode *ip1,
uint ip1_mode) uint ip1_mode)
{ {
struct xfs_inode *temp;
uint mode_temp;
int attempts = 0; int attempts = 0;
struct xfs_log_item *lp; struct xfs_log_item *lp;
...@@ -578,12 +576,8 @@ xfs_lock_two_inodes( ...@@ -578,12 +576,8 @@ xfs_lock_two_inodes(
ASSERT(ip0->i_ino != ip1->i_ino); ASSERT(ip0->i_ino != ip1->i_ino);
if (ip0->i_ino > ip1->i_ino) { if (ip0->i_ino > ip1->i_ino) {
temp = ip0; swap(ip0, ip1);
ip0 = ip1; swap(ip0_mode, ip1_mode);
ip1 = temp;
mode_temp = ip0_mode;
ip0_mode = ip1_mode;
ip1_mode = mode_temp;
} }
again: again:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册