summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorYang Guang <yang.guang5@zte.com.cn>2021-11-04 14:21:58 +0800
committerDavid S. Miller <davem@davemloft.net>2021-11-05 10:14:38 +0000
commitd7be1d1cfb4d3215c06e98ac6f6c4e99293d8e3c (patch)
tree19612671c1bd5e303d94276c01bbaad8676b9634 /drivers/net
parent0c500ef5d3395b68f615486c90aaf28868e0032c (diff)
octeontx2-af: use swap() to make code cleaner
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Yang Guang <yang.guang5@zte.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index bb6b42bbefa4..c0005a1feee6 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -2450,9 +2450,7 @@ alloc:
bmap = mcam->bmap_reverse;
start = mcam->bmap_entries - start;
end = mcam->bmap_entries - end;
- index = start;
- start = end;
- end = index;
+ swap(start, end);
} else {
bmap = mcam->bmap;
}