Skip to content

Commit

Permalink
net: mpls: Remove duplicate variable from iterator macro
Browse files Browse the repository at this point in the history
__nh is just a copy of nh with a different type.

Signed-off-by: Benjamin Poirier <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
gobenji authored and davem330 committed Nov 29, 2021
1 parent 688e075 commit 69d9c0d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions net/mpls/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down

0 comments on commit 69d9c0d

Please sign in to comment.