From: Yang Guang Date: Thu, 28 Apr 2022 19:39:04 +0000 (-0400) Subject: xfs: use swap() to make dabtree code cleaner X-Git-Tag: v5.16.0-rc0~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=016bb3d18d24ccf5709deafbc6e928cbeb92a160;p=thirdparty%2Fxfsprogs-dev.git xfs: use swap() to make dabtree code cleaner Source kernel commit: 5b068aadf62da006891383f6b23e47bc3ad49995 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 Signed-off-by: Eric Sandeen --- 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;