Skip to content

Commit

Permalink
net-next: remove useless union keyword
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
xiaosuo authored and davem330 committed Jun 11, 2010
1 parent 592fcb9 commit d8d1f30
Show file tree
Hide file tree
Showing 55 changed files with 694 additions and 709 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,

neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->idev->dev);
if (!neigh || !(neigh->nud_state & NUD_VALID)) {
neigh_event_send(rt->u.dst.neighbour, NULL);
neigh_event_send(rt->dst.neighbour, NULL);
ret = -ENODATA;
if (neigh)
goto release;
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/cxgb3/iwch_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
__func__);
goto reject;
}
dst = &rt->u.dst;
dst = &rt->dst;
l2t = t3_l2t_get(tdev, dst->neighbour, dst->neighbour->dev);
if (!l2t) {
printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n",
Expand Down Expand Up @@ -1932,7 +1932,7 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
err = -EHOSTUNREACH;
goto fail3;
}
ep->dst = &rt->u.dst;
ep->dst = &rt->dst;

/* get a l2t entry */
ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst->neighbour,
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/cxgb4/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
__func__);
goto reject;
}
dst = &rt->u.dst;
dst = &rt->dst;
if (dst->neighbour->dev->flags & IFF_LOOPBACK) {
pdev = ip_dev_find(&init_net, peer_ip);
BUG_ON(!pdev);
Expand Down Expand Up @@ -1938,7 +1938,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
err = -EHOSTUNREACH;
goto fail3;
}
ep->dst = &rt->u.dst;
ep->dst = &rt->dst;

/* get a l2t entry */
if (ep->dst->neighbour->dev->flags & IFF_LOOPBACK) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/nes/nes_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
}

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

ip_rt_put(rt);
return rc;
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2584,7 +2584,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
/*
* This target is not on a VLAN
*/
if (rt->u.dst.dev == bond->dev) {
if (rt->dst.dev == bond->dev) {
ip_rt_put(rt);
pr_debug("basa: rtdev == bond->dev: arp_send\n");
bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
Expand All @@ -2595,7 +2595,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
vlan_id = 0;
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id);
if (vlan_dev == rt->u.dst.dev) {
if (vlan_dev == rt->dst.dev) {
vlan_id = vlan->vlan_id;
pr_debug("basa: vlan match on %s %d\n",
vlan_dev->name, vlan_id);
Expand All @@ -2613,7 +2613,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
if (net_ratelimit()) {
pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
bond->dev->name, &fl.fl4_dst,
rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
rt->dst.dev ? rt->dst.dev->name : "NULL");
}
ip_rt_put(rt);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2824,7 +2824,7 @@ static int cnic_get_v4_route(struct sockaddr_in *dst_addr,

err = ip_route_output_key(&init_net, &rt, &fl);
if (!err)
*dst = &rt->u.dst;
*dst = &rt->dst;
return err;
#else
return -ENETUNREACH;
Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/cxgb3i/cxgb3i_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ cxgb3i_find_dev(struct net_device *dev, __be32 ipaddr)

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

return NULL;
}
Expand Down Expand Up @@ -1649,7 +1649,7 @@ int cxgb3i_c3cn_connect(struct net_device *dev, struct s3_conn *c3cn,
c3cn->saddr.sin_addr.s_addr = rt->rt_src;

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

/* try to establish an offloaded connection */
dev = cxgb3_egress_dev(c3cn->dst_cache->dev, c3cn, 0);
Expand Down
4 changes: 1 addition & 3 deletions include/net/dn_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ extern void dn_rt_cache_flush(int delay);
* packets to the originating host.
*/
struct dn_route {
union {
struct dst_entry dst;
} u;
struct dst_entry dst;

struct flowi fl;

Expand Down
10 changes: 4 additions & 6 deletions include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@ struct rt6key {
struct fib6_table;

struct rt6_info {
union {
struct dst_entry dst;
} u;
struct dst_entry dst;

#define rt6i_dev u.dst.dev
#define rt6i_nexthop u.dst.neighbour
#define rt6i_expires u.dst.expires
#define rt6i_dev dst.dev
#define rt6i_nexthop dst.neighbour
#define rt6i_expires dst.expires

/*
* Tail elements of dst_entry (__refcnt etc.)
Expand Down
2 changes: 1 addition & 1 deletion include/net/ipip.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct ip_tunnel_prl_entry {
int pkt_len = skb->len - skb_transport_offset(skb); \
\
skb->ip_summed = CHECKSUM_NONE; \
ip_select_ident(iph, &rt->u.dst, NULL); \
ip_select_ident(iph, &rt->dst, NULL); \
\
err = ip_local_out(skb); \
if (likely(net_xmit_eval(err) == 0)) { \
Expand Down
6 changes: 2 additions & 4 deletions include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
struct fib_nh;
struct inet_peer;
struct rtable {
union {
struct dst_entry dst;
} u;
struct dst_entry dst;

/* Cache lookup keys */
struct flowi fl;
Expand Down Expand Up @@ -144,7 +142,7 @@ extern void fib_add_ifaddr(struct in_ifaddr *);
static inline void ip_rt_put(struct rtable * rt)
{
if (rt)
dst_release(&rt->u.dst);
dst_release(&rt->dst);
}

#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3)
Expand Down
2 changes: 1 addition & 1 deletion net/atm/clip.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
error = ip_route_output_key(&init_net, &rt, &fl);
if (error)
return error;
neigh = __neigh_lookup(&clip_tbl, &ip, rt->u.dst.dev, 1);
neigh = __neigh_lookup(&clip_tbl, &ip, rt->dst.dev, 1);
ip_rt_put(rt);
if (!neigh)
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int br_change_mtu(struct net_device *dev, int new_mtu)

#ifdef CONFIG_BRIDGE_NETFILTER
/* remember the MTU in the rtable for PMTU */
br->fake_rtable.u.dst.metrics[RTAX_MTU - 1] = new_mtu;
br->fake_rtable.dst.metrics[RTAX_MTU - 1] = new_mtu;
#endif

return 0;
Expand Down
20 changes: 10 additions & 10 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ void br_netfilter_rtable_init(struct net_bridge *br)
{
struct rtable *rt = &br->fake_rtable;

atomic_set(&rt->u.dst.__refcnt, 1);
rt->u.dst.dev = br->dev;
rt->u.dst.path = &rt->u.dst;
rt->u.dst.metrics[RTAX_MTU - 1] = 1500;
rt->u.dst.flags = DST_NOXFRM;
rt->u.dst.ops = &fake_dst_ops;
atomic_set(&rt->dst.__refcnt, 1);
rt->dst.dev = br->dev;
rt->dst.path = &rt->dst;
rt->dst.metrics[RTAX_MTU - 1] = 1500;
rt->dst.flags = DST_NOXFRM;
rt->dst.ops = &fake_dst_ops;
}

static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
Expand Down Expand Up @@ -244,8 +244,8 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb)
kfree_skb(skb);
return 0;
}
dst_hold(&rt->u.dst);
skb_dst_set(skb, &rt->u.dst);
dst_hold(&rt->dst);
skb_dst_set(skb, &rt->dst);

skb->dev = nf_bridge->physindev;
nf_bridge_update_protocol(skb);
Expand Down Expand Up @@ -396,8 +396,8 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
kfree_skb(skb);
return 0;
}
dst_hold(&rt->u.dst);
skb_dst_set(skb, &rt->u.dst);
dst_hold(&rt->dst);
skb_dst_set(skb, &rt->dst);
}

skb->dev = nf_bridge->physindev;
Expand Down
4 changes: 2 additions & 2 deletions net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
goto failure;

/* OK, now commit destination to socket. */
sk_setup_caps(sk, &rt->u.dst);
sk_setup_caps(sk, &rt->dst);

dp->dccps_iss = secure_dccp_sequence_number(inet->inet_saddr,
inet->inet_daddr,
Expand Down Expand Up @@ -475,7 +475,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
return NULL;
}

return &rt->u.dst;
return &rt->dst;
}

static int dccp_v4_send_response(struct sock *sk, struct request_sock *req,
Expand Down
Loading

0 comments on commit d8d1f30

Please sign in to comment.