[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211129062316.221653-2-bpoirier@nvidia.com>
Date: Mon, 29 Nov 2021 15:23:15 +0900
From: Benjamin Poirier <bpoirier@...dia.com>
To: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
CC: Kangmin Park <l4stpr0gr4m@...il.com>,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
<netdev@...r.kernel.org>, Roopa Prabhu <roopa@...dia.com>,
David Ahern <dsahern@...il.com>
Subject: [PATCH net-next 1/2] net: mpls: Remove duplicate variable from iterator macro
__nh is just a copy of nh with a different type.
Signed-off-by: Benjamin Poirier <bpoirier@...dia.com>
---
net/mpls/internal.h | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/net/mpls/internal.h b/net/mpls/internal.h
index 838cdfc10e47..218138f5b491 100644
--- a/net/mpls/internal.h
+++ b/net/mpls/internal.h
@@ -158,17 +158,16 @@ struct mpls_route { /* next hop label forwarding entry */
};
#define for_nexthops(rt) { \
- int nhsel; struct mpls_nh *nh; u8 *__nh; \
- for (nhsel = 0, nh = (rt)->rt_nh, __nh = (u8 *)((rt)->rt_nh); \
+ int nhsel; struct mpls_nh *nh; \
+ for (nhsel = 0, nh = (rt)->rt_nh; \
nhsel < (rt)->rt_nhn; \
- __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
+ nh = (void *)nh + (rt)->rt_nh_size, nhsel++)
#define change_nexthops(rt) { \
- int nhsel; struct mpls_nh *nh; u8 *__nh; \
- for (nhsel = 0, nh = (struct mpls_nh *)((rt)->rt_nh), \
- __nh = (u8 *)((rt)->rt_nh); \
+ int nhsel; struct mpls_nh *nh; \
+ for (nhsel = 0, nh = (rt)->rt_nh; \
nhsel < (rt)->rt_nhn; \
- __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
+ nh = (void *)nh + (rt)->rt_nh_size, nhsel++)
#define endfor_nexthops(rt) }
--
2.33.1
Powered by blists - more mailing lists