diff options
author | Ian Morris <ipm@chirality.org.uk> | 2014-08-24 16:53:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-25 01:37:52 -0400 |
commit | 67ba4152e8b77eada6a9c64e3c2c84d6112794fc (patch) | |
tree | 833bd7925ed3b69ef65f759c3f806cdaa8643d00 /net/ipv6/ip6_tunnel.c | |
parent | a9b0b2faa8ed299ca617a317e2abb9ea1bf0e733 (diff) |
ipv6: White-space cleansing : Line Layouts
This patch makes no changes to the logic of the code but simply addresses
coding style issues as detected by checkpatch.
Both objdump and diff -w show no differences.
A number of items are addressed in this patch:
* Multiple spaces converted to tabs
* Spaces before tabs removed.
* Spaces in pointer typing cleansed (char *)foo etc.
* Remove space after sizeof
* Ensure spacing around comparators such as if statements.
Signed-off-by: Ian Morris <ipm@chirality.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index f9de5a695072..e01bd0399297 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -408,12 +408,12 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw) | |||
408 | { | 408 | { |
409 | const struct ipv6hdr *ipv6h = (const struct ipv6hdr *) raw; | 409 | const struct ipv6hdr *ipv6h = (const struct ipv6hdr *) raw; |
410 | __u8 nexthdr = ipv6h->nexthdr; | 410 | __u8 nexthdr = ipv6h->nexthdr; |
411 | __u16 off = sizeof (*ipv6h); | 411 | __u16 off = sizeof(*ipv6h); |
412 | 412 | ||
413 | while (ipv6_ext_hdr(nexthdr) && nexthdr != NEXTHDR_NONE) { | 413 | while (ipv6_ext_hdr(nexthdr) && nexthdr != NEXTHDR_NONE) { |
414 | __u16 optlen = 0; | 414 | __u16 optlen = 0; |
415 | struct ipv6_opt_hdr *hdr; | 415 | struct ipv6_opt_hdr *hdr; |
416 | if (raw + off + sizeof (*hdr) > skb->data && | 416 | if (raw + off + sizeof(*hdr) > skb->data && |
417 | !pskb_may_pull(skb, raw - skb->data + off + sizeof (*hdr))) | 417 | !pskb_may_pull(skb, raw - skb->data + off + sizeof (*hdr))) |
418 | break; | 418 | break; |
419 | 419 | ||
@@ -530,7 +530,7 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt, | |||
530 | mtu = IPV6_MIN_MTU; | 530 | mtu = IPV6_MIN_MTU; |
531 | t->dev->mtu = mtu; | 531 | t->dev->mtu = mtu; |
532 | 532 | ||
533 | if ((len = sizeof (*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) { | 533 | if ((len = sizeof(*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) { |
534 | rel_type = ICMPV6_PKT_TOOBIG; | 534 | rel_type = ICMPV6_PKT_TOOBIG; |
535 | rel_code = 0; | 535 | rel_code = 0; |
536 | rel_info = mtu; | 536 | rel_info = mtu; |
@@ -991,7 +991,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
991 | t->parms.name); | 991 | t->parms.name); |
992 | goto tx_err_dst_release; | 992 | goto tx_err_dst_release; |
993 | } | 993 | } |
994 | mtu = dst_mtu(dst) - sizeof (*ipv6h); | 994 | mtu = dst_mtu(dst) - sizeof(*ipv6h); |
995 | if (encap_limit >= 0) { | 995 | if (encap_limit >= 0) { |
996 | max_headroom += 8; | 996 | max_headroom += 8; |
997 | mtu -= 8; | 997 | mtu -= 8; |
@@ -1083,7 +1083,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1083 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1083 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1084 | encap_limit = t->parms.encap_limit; | 1084 | encap_limit = t->parms.encap_limit; |
1085 | 1085 | ||
1086 | memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6)); | 1086 | memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6)); |
1087 | fl6.flowi6_proto = IPPROTO_IPIP; | 1087 | fl6.flowi6_proto = IPPROTO_IPIP; |
1088 | 1088 | ||
1089 | dsfield = ipv4_get_dsfield(iph); | 1089 | dsfield = ipv4_get_dsfield(iph); |
@@ -1135,7 +1135,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1135 | } else if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1135 | } else if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1136 | encap_limit = t->parms.encap_limit; | 1136 | encap_limit = t->parms.encap_limit; |
1137 | 1137 | ||
1138 | memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6)); | 1138 | memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6)); |
1139 | fl6.flowi6_proto = IPPROTO_IPV6; | 1139 | fl6.flowi6_proto = IPPROTO_IPV6; |
1140 | 1140 | ||
1141 | dsfield = ipv6_get_dsfield(ipv6h); | 1141 | dsfield = ipv6_get_dsfield(ipv6h); |
@@ -1229,11 +1229,11 @@ static void ip6_tnl_link_config(struct ip6_tnl *t) | |||
1229 | 1229 | ||
1230 | if (rt->dst.dev) { | 1230 | if (rt->dst.dev) { |
1231 | dev->hard_header_len = rt->dst.dev->hard_header_len + | 1231 | dev->hard_header_len = rt->dst.dev->hard_header_len + |
1232 | sizeof (struct ipv6hdr); | 1232 | sizeof(struct ipv6hdr); |
1233 | 1233 | ||
1234 | dev->mtu = rt->dst.dev->mtu - sizeof (struct ipv6hdr); | 1234 | dev->mtu = rt->dst.dev->mtu - sizeof(struct ipv6hdr); |
1235 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1235 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1236 | dev->mtu-=8; | 1236 | dev->mtu -= 8; |
1237 | 1237 | ||
1238 | if (dev->mtu < IPV6_MIN_MTU) | 1238 | if (dev->mtu < IPV6_MIN_MTU) |
1239 | dev->mtu = IPV6_MIN_MTU; | 1239 | dev->mtu = IPV6_MIN_MTU; |
@@ -1350,7 +1350,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1350 | switch (cmd) { | 1350 | switch (cmd) { |
1351 | case SIOCGETTUNNEL: | 1351 | case SIOCGETTUNNEL: |
1352 | if (dev == ip6n->fb_tnl_dev) { | 1352 | if (dev == ip6n->fb_tnl_dev) { |
1353 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) { | 1353 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) { |
1354 | err = -EFAULT; | 1354 | err = -EFAULT; |
1355 | break; | 1355 | break; |
1356 | } | 1356 | } |
@@ -1362,7 +1362,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1362 | memset(&p, 0, sizeof(p)); | 1362 | memset(&p, 0, sizeof(p)); |
1363 | } | 1363 | } |
1364 | ip6_tnl_parm_to_user(&p, &t->parms); | 1364 | ip6_tnl_parm_to_user(&p, &t->parms); |
1365 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) { | 1365 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) { |
1366 | err = -EFAULT; | 1366 | err = -EFAULT; |
1367 | } | 1367 | } |
1368 | break; | 1368 | break; |
@@ -1372,7 +1372,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1372 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) | 1372 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) |
1373 | break; | 1373 | break; |
1374 | err = -EFAULT; | 1374 | err = -EFAULT; |
1375 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) | 1375 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) |
1376 | break; | 1376 | break; |
1377 | err = -EINVAL; | 1377 | err = -EINVAL; |
1378 | if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP && | 1378 | if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP && |
@@ -1407,7 +1407,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1407 | 1407 | ||
1408 | if (dev == ip6n->fb_tnl_dev) { | 1408 | if (dev == ip6n->fb_tnl_dev) { |
1409 | err = -EFAULT; | 1409 | err = -EFAULT; |
1410 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) | 1410 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) |
1411 | break; | 1411 | break; |
1412 | err = -ENOENT; | 1412 | err = -ENOENT; |
1413 | ip6_tnl_parm_from_user(&p1, &p); | 1413 | ip6_tnl_parm_from_user(&p1, &p); |
@@ -1482,11 +1482,11 @@ static void ip6_tnl_dev_setup(struct net_device *dev) | |||
1482 | dev->destructor = ip6_dev_free; | 1482 | dev->destructor = ip6_dev_free; |
1483 | 1483 | ||
1484 | dev->type = ARPHRD_TUNNEL6; | 1484 | dev->type = ARPHRD_TUNNEL6; |
1485 | dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); | 1485 | dev->hard_header_len = LL_MAX_HEADER + sizeof(struct ipv6hdr); |
1486 | dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); | 1486 | dev->mtu = ETH_DATA_LEN - sizeof(struct ipv6hdr); |
1487 | t = netdev_priv(dev); | 1487 | t = netdev_priv(dev); |
1488 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1488 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1489 | dev->mtu-=8; | 1489 | dev->mtu -= 8; |
1490 | dev->flags |= IFF_NOARP; | 1490 | dev->flags |= IFF_NOARP; |
1491 | dev->addr_len = sizeof(struct in6_addr); | 1491 | dev->addr_len = sizeof(struct in6_addr); |
1492 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 1492 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; |