Skip to content

Commit d8d1f30

Browse files
xiaosuodavem330
authored andcommitted
net-next: remove useless union keyword
remove useless union keyword in rtable, rt6_info and dn_route. Since there is only one member in a union, the union keyword isn't useful. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 592fcb9 commit d8d1f30

55 files changed

Lines changed: 694 additions & 709 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/infiniband/core/addr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
215215

216216
neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->idev->dev);
217217
if (!neigh || !(neigh->nud_state & NUD_VALID)) {
218-
neigh_event_send(rt->u.dst.neighbour, NULL);
218+
neigh_event_send(rt->dst.neighbour, NULL);
219219
ret = -ENODATA;
220220
if (neigh)
221221
goto release;

‎drivers/infiniband/hw/cxgb3/iwch_cm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
13641364
__func__);
13651365
goto reject;
13661366
}
1367-
dst = &rt->u.dst;
1367+
dst = &rt->dst;
13681368
l2t = t3_l2t_get(tdev, dst->neighbour, dst->neighbour->dev);
13691369
if (!l2t) {
13701370
printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n",
@@ -1932,7 +1932,7 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
19321932
err = -EHOSTUNREACH;
19331933
goto fail3;
19341934
}
1935-
ep->dst = &rt->u.dst;
1935+
ep->dst = &rt->dst;
19361936

19371937
/* get a l2t entry */
19381938
ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst->neighbour,

‎drivers/infiniband/hw/cxgb4/cm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
13641364
__func__);
13651365
goto reject;
13661366
}
1367-
dst = &rt->u.dst;
1367+
dst = &rt->dst;
13681368
if (dst->neighbour->dev->flags & IFF_LOOPBACK) {
13691369
pdev = ip_dev_find(&init_net, peer_ip);
13701370
BUG_ON(!pdev);
@@ -1938,7 +1938,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
19381938
err = -EHOSTUNREACH;
19391939
goto fail3;
19401940
}
1941-
ep->dst = &rt->u.dst;
1941+
ep->dst = &rt->dst;
19421942

19431943
/* get a l2t entry */
19441944
if (ep->dst->neighbour->dev->flags & IFF_LOOPBACK) {

‎drivers/infiniband/hw/nes/nes_cm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
11461146
}
11471147

11481148
if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID)))
1149-
neigh_event_send(rt->u.dst.neighbour, NULL);
1149+
neigh_event_send(rt->dst.neighbour, NULL);
11501150

11511151
ip_rt_put(rt);
11521152
return rc;

‎drivers/net/bonding/bond_main.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
25842584
/*
25852585
* This target is not on a VLAN
25862586
*/
2587-
if (rt->u.dst.dev == bond->dev) {
2587+
if (rt->dst.dev == bond->dev) {
25882588
ip_rt_put(rt);
25892589
pr_debug("basa: rtdev == bond->dev: arp_send\n");
25902590
bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
@@ -2595,7 +2595,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
25952595
vlan_id = 0;
25962596
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
25972597
vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id);
2598-
if (vlan_dev == rt->u.dst.dev) {
2598+
if (vlan_dev == rt->dst.dev) {
25992599
vlan_id = vlan->vlan_id;
26002600
pr_debug("basa: vlan match on %s %d\n",
26012601
vlan_dev->name, vlan_id);
@@ -2613,7 +2613,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
26132613
if (net_ratelimit()) {
26142614
pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
26152615
bond->dev->name, &fl.fl4_dst,
2616-
rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
2616+
rt->dst.dev ? rt->dst.dev->name : "NULL");
26172617
}
26182618
ip_rt_put(rt);
26192619
}

‎drivers/net/cnic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2824,7 +2824,7 @@ static int cnic_get_v4_route(struct sockaddr_in *dst_addr,
28242824

28252825
err = ip_route_output_key(&init_net, &rt, &fl);
28262826
if (!err)
2827-
*dst = &rt->u.dst;
2827+
*dst = &rt->dst;
28282828
return err;
28292829
#else
28302830
return -ENETUNREACH;

‎drivers/scsi/cxgb3i/cxgb3i_offload.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@ cxgb3i_find_dev(struct net_device *dev, __be32 ipaddr)
15871587

15881588
err = ip_route_output_key(dev ? dev_net(dev) : &init_net, &rt, &fl);
15891589
if (!err)
1590-
return (&rt->u.dst)->dev;
1590+
return (&rt->dst)->dev;
15911591

15921592
return NULL;
15931593
}
@@ -1649,7 +1649,7 @@ int cxgb3i_c3cn_connect(struct net_device *dev, struct s3_conn *c3cn,
16491649
c3cn->saddr.sin_addr.s_addr = rt->rt_src;
16501650

16511651
/* now commit destination to connection */
1652-
c3cn->dst_cache = &rt->u.dst;
1652+
c3cn->dst_cache = &rt->dst;
16531653

16541654
/* try to establish an offloaded connection */
16551655
dev = cxgb3_egress_dev(c3cn->dst_cache->dev, c3cn, 0);

‎include/net/dn_route.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ extern void dn_rt_cache_flush(int delay);
6565
* packets to the originating host.
6666
*/
6767
struct dn_route {
68-
union {
69-
struct dst_entry dst;
70-
} u;
68+
struct dst_entry dst;
7169

7270
struct flowi fl;
7371

‎include/net/ip6_fib.h‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,11 @@ struct rt6key {
8484
struct fib6_table;
8585

8686
struct rt6_info {
87-
union {
88-
struct dst_entry dst;
89-
} u;
87+
struct dst_entry dst;
9088

91-
#define rt6i_dev u.dst.dev
92-
#define rt6i_nexthop u.dst.neighbour
93-
#define rt6i_expires u.dst.expires
89+
#define rt6i_dev dst.dev
90+
#define rt6i_nexthop dst.neighbour
91+
#define rt6i_expires dst.expires
9492

9593
/*
9694
* Tail elements of dst_entry (__refcnt etc.)

‎include/net/ipip.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct ip_tunnel_prl_entry {
5050
int pkt_len = skb->len - skb_transport_offset(skb); \
5151
\
5252
skb->ip_summed = CHECKSUM_NONE; \
53-
ip_select_ident(iph, &rt->u.dst, NULL); \
53+
ip_select_ident(iph, &rt->dst, NULL); \
5454
\
5555
err = ip_local_out(skb); \
5656
if (likely(net_xmit_eval(err) == 0)) { \

0 commit comments

Comments
 (0)