octeontx2-af: use swap() to make code cleaner
authorYang Guang <yang.guang5@zte.com.cn>
Thu, 4 Nov 2021 06:21:58 +0000 (14:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Nov 2021 10:14:38 +0000 (10:14 +0000)
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>
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c

index bb6b42b..c0005a1 100644 (file)
@@ -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;
        }