From: Yang Guang Date: Thu, 6 Jan 2022 22:13:24 +0000 (-0800) Subject: xfs: use swap() to make dabtree code cleaner X-Git-Tag: libxfs-5.16-sync_2022-04-18~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=21ca43dacb928f904da18596bc57446c33bce56c;p=thirdparty%2Fxfsprogs-dev.git xfs: use swap() to make dabtree code cleaner Source kernel commit: d3d48fb93ba48bd3cb5c564235bfbc96fe4d0d7f Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yang Guang Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index 50f3ec661..1f39c1087 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -861,7 +861,6 @@ xfs_da3_node_rebalance( { struct xfs_da_intnode *node1; struct xfs_da_intnode *node2; - struct xfs_da_intnode *tmpnode; struct xfs_da_node_entry *btree1; struct xfs_da_node_entry *btree2; struct xfs_da_node_entry *btree_s; @@ -891,9 +890,7 @@ xfs_da3_node_rebalance( ((be32_to_cpu(btree2[0].hashval) < be32_to_cpu(btree1[0].hashval)) || (be32_to_cpu(btree2[nodehdr2.count - 1].hashval) < be32_to_cpu(btree1[nodehdr1.count - 1].hashval)))) { - tmpnode = node1; - node1 = node2; - node2 = tmpnode; + swap(node1, node2); xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr1, node1); xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr2, node2); btree1 = nodehdr1.btree;