Skip to content

Commit

Permalink
ipv6: White-space cleansing : Line Layouts
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
lz7tq4 authored and davem330 committed Aug 25, 2014
1 parent a9b0b2f commit 67ba415
Show file tree
Hide file tree
Showing 31 changed files with 203 additions and 203 deletions.
12 changes: 6 additions & 6 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
.rtr_solicits = MAX_RTR_SOLICITATIONS,
.rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
.rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY,
.use_tempaddr = 0,
.use_tempaddr = 0,
.temp_valid_lft = TEMP_VALID_LIFETIME,
.temp_prefered_lft = TEMP_PREFERRED_LIFETIME,
.regen_max_retry = REGEN_MAX_RETRY,
Expand Down Expand Up @@ -1105,8 +1105,8 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *i
spin_unlock_bh(&ifp->lock);

regen_advance = idev->cnf.regen_max_retry *
idev->cnf.dad_transmits *
NEIGH_VAR(idev->nd_parms, RETRANS_TIME) / HZ;
idev->cnf.dad_transmits *
NEIGH_VAR(idev->nd_parms, RETRANS_TIME) / HZ;
write_unlock_bh(&idev->lock);

/* A temporary address is created only if this calculated Preferred
Expand Down Expand Up @@ -3035,7 +3035,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
struct hlist_head *h = &inet6_addr_lst[i];

spin_lock_bh(&addrconf_hash_lock);
restart:
restart:
hlist_for_each_entry_rcu(ifa, h, addr_lst) {
if (ifa->idev == idev) {
hlist_del_init_rcu(&ifa->addr_lst);
Expand Down Expand Up @@ -3547,8 +3547,8 @@ static void __net_exit if6_proc_net_exit(struct net *net)
}

static struct pernet_operations if6_proc_net_ops = {
.init = if6_proc_net_init,
.exit = if6_proc_net_exit,
.init = if6_proc_net_init,
.exit = if6_proc_net_exit,
};

int __init if6_proc_init(void)
Expand Down
12 changes: 6 additions & 6 deletions net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
*
* Adapted from linux/net/ipv4/af_inet.c
*
* Fixes:
* Fixes:
* piggy, Karl Knutson : Socket protocol table
* Hideaki YOSHIFUJI : sin6_scope_id support
* Arnaldo Melo : check proc_net_create return, cleanups
* Hideaki YOSHIFUJI : sin6_scope_id support
* Arnaldo Melo : check proc_net_create return, cleanups
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/

#define pr_fmt(fmt) "IPv6: " fmt
Expand Down
16 changes: 8 additions & 8 deletions net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* Authors
*
* Mitsuru KANDA @USAGI : IPv6 Support
* Kazunori MIYAZAWA @USAGI :
* Kunihiro Ishiguro <[email protected]>
* Kazunori MIYAZAWA @USAGI :
* Kunihiro Ishiguro <[email protected]>
*
* This file is derived from net/ipv4/ah.c.
* This file is derived from net/ipv4/ah.c.
*/

#define pr_fmt(fmt) "IPv6: " fmt
Expand Down Expand Up @@ -284,7 +284,7 @@ static int ipv6_clear_mutable_options(struct ipv6hdr *iph, int len, int dir)
ipv6_rearrange_rthdr(iph, exthdr.rth);
break;

default :
default:
return 0;
}

Expand Down Expand Up @@ -478,7 +478,7 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
auth_data = ah_tmp_auth(work_iph, hdr_len);
icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);

err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG: 0;
err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
if (err)
goto out;

Expand Down Expand Up @@ -622,7 +622,7 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
goto out_free;
}

err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG: 0;
err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
if (err)
goto out_free;

Expand All @@ -647,8 +647,8 @@ static int ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
u8 type, u8 code, int offset, __be32 info)
{
struct net *net = dev_net(skb->dev);
struct ipv6hdr *iph = (struct ipv6hdr*)skb->data;
struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset);
struct ipv6hdr *iph = (struct ipv6hdr *)skb->data;
struct ip_auth_hdr *ah = (struct ip_auth_hdr *)(skb->data+offset);
struct xfrm_state *x;

if (type != ICMPV6_PKT_TOOBIG &&
Expand Down
8 changes: 4 additions & 4 deletions net/ipv6/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ static bool ipv6_mapped_addr_any(const struct in6_addr *a)
int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *daddr, *final_p, final;
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *daddr, *final_p, final;
struct dst_entry *dst;
struct flowi6 fl6;
struct ip6_flowlabel *flowlabel = NULL;
struct ipv6_txoptions *opt;
struct ipv6_txoptions *opt;
int addr_type;
int err;

Expand Down
8 changes: 4 additions & 4 deletions net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* Authors
*
* Mitsuru KANDA @USAGI : IPv6 Support
* Kazunori MIYAZAWA @USAGI :
* Kunihiro Ishiguro <[email protected]>
* Kazunori MIYAZAWA @USAGI :
* Kunihiro Ishiguro <[email protected]>
*
* This file is derived from net/ipv4/esp.c
* This file is derived from net/ipv4/esp.c
*/

#define pr_fmt(fmt) "IPv6: " fmt
Expand Down Expand Up @@ -598,7 +598,7 @@ static int esp6_init_state(struct xfrm_state *x)
case XFRM_MODE_BEET:
if (x->sel.family != AF_INET6)
x->props.header_len += IPV4_BEET_PHMAXLEN +
(sizeof(struct ipv6hdr) - sizeof(struct iphdr));
(sizeof(struct ipv6hdr) - sizeof(struct iphdr));
break;
case XFRM_MODE_TRANSPORT:
break;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static bool ip6_parse_tlv(const struct tlvtype_proc *procs, struct sk_buff *skb)
default: /* Other TLV code so scan list */
if (optlen > len)
goto bad;
for (curr=procs; curr->type >= 0; curr++) {
for (curr = procs; curr->type >= 0; curr++) {
if (curr->type == nh[off]) {
/* type specific length/alignment
checks will be performed in the
Expand Down
10 changes: 5 additions & 5 deletions net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
msg.type = type;

len = skb->len - msg.offset;
len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr));
len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) - sizeof(struct icmp6hdr));
if (len < 0) {
LIMIT_NETDEBUG(KERN_DEBUG "icmp: len problem\n");
goto out_dst_release;
Expand Down Expand Up @@ -636,7 +636,7 @@ void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info)
/* now skip over extension headers */
inner_offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr),
&nexthdr, &frag_off);
if (inner_offset<0)
if (inner_offset < 0)
goto out;
} else {
inner_offset = sizeof(struct ipv6hdr);
Expand Down Expand Up @@ -808,7 +808,7 @@ void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6,
memset(fl6, 0, sizeof(*fl6));
fl6->saddr = *saddr;
fl6->daddr = *daddr;
fl6->flowi6_proto = IPPROTO_ICMPV6;
fl6->flowi6_proto = IPPROTO_ICMPV6;
fl6->fl6_icmp_type = type;
fl6->fl6_icmp_code = 0;
fl6->flowi6_oif = oif;
Expand Down Expand Up @@ -875,8 +875,8 @@ static void __net_exit icmpv6_sk_exit(struct net *net)
}

static struct pernet_operations icmpv6_sk_ops = {
.init = icmpv6_sk_init,
.exit = icmpv6_sk_exit,
.init = icmpv6_sk_init,
.exit = icmpv6_sk_exit,
};

int __init icmpv6_init(void)
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/inet6_connection_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void inet6_csk_reqsk_queue_hash_add(struct sock *sk,

EXPORT_SYMBOL_GPL(inet6_csk_reqsk_queue_hash_add);

void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr)
void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr)
{
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) uaddr;

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/inet6_hashtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Generic INET6 transport hashtables
*
* Authors: Lotsa people, from code originally in tcp, generalised here
* by Arnaldo Carvalho de Melo <[email protected]>
* by Arnaldo Carvalho de Melo <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down
18 changes: 9 additions & 9 deletions net/ipv6/ip6_flowlabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void ip6_fl_gc(unsigned long dummy)

spin_lock(&ip6_fl_lock);

for (i=0; i<=FL_HASH_MASK; i++) {
for (i = 0; i <= FL_HASH_MASK; i++) {
struct ip6_flowlabel *fl;
struct ip6_flowlabel __rcu **flp;

Expand Down Expand Up @@ -239,7 +239,7 @@ static struct ip6_flowlabel *fl_intern(struct net *net,

/* Socket flowlabel lists */

struct ip6_flowlabel * fl6_sock_lookup(struct sock *sk, __be32 label)
struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label)
{
struct ipv6_fl_socklist *sfl;
struct ipv6_pinfo *np = inet6_sk(sk);
Expand Down Expand Up @@ -293,11 +293,11 @@ void fl6_free_socklist(struct sock *sk)
following rthdr.
*/

struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space,
struct ip6_flowlabel * fl,
struct ipv6_txoptions * fopt)
struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
struct ip6_flowlabel *fl,
struct ipv6_txoptions *fopt)
{
struct ipv6_txoptions * fl_opt = fl->opt;
struct ipv6_txoptions *fl_opt = fl->opt;

if (fopt == NULL || fopt->opt_flen == 0)
return fl_opt;
Expand Down Expand Up @@ -388,7 +388,7 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,
goto done;

msg.msg_controllen = olen;
msg.msg_control = (void*)(fl->opt+1);
msg.msg_control = (void *)(fl->opt+1);
memset(&flowi6, 0, sizeof(flowi6));

err = ip6_datagram_send_ctl(net, sk, &msg, &flowi6, fl->opt,
Expand Down Expand Up @@ -517,7 +517,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
struct net *net = sock_net(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_flowlabel_req freq;
struct ipv6_fl_socklist *sfl1=NULL;
struct ipv6_fl_socklist *sfl1 = NULL;
struct ipv6_fl_socklist *sfl;
struct ipv6_fl_socklist __rcu **sflp;
struct ip6_flowlabel *fl, *fl1 = NULL;
Expand All @@ -542,7 +542,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
}
spin_lock_bh(&ip6_sk_fl_lock);
for (sflp = &np->ipv6_fl_list;
(sfl = rcu_dereference(*sflp))!=NULL;
(sfl = rcu_dereference(*sflp)) != NULL;
sflp = &sfl->next) {
if (sfl->fl->label == freq.flr_label) {
if (freq.flr_label == (np->flow_label&IPV6_FLOWLABEL_MASK))
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/ip6_icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static ip6_icmp_send_t __rcu *ip6_icmp_send;
int inet6_register_icmp_sender(ip6_icmp_send_t *fn)
{
return (cmpxchg((ip6_icmp_send_t **)&ip6_icmp_send, NULL, fn) == NULL) ?
0 : -EBUSY;
0 : -EBUSY;
}
EXPORT_SYMBOL(inet6_register_icmp_sender);

Expand Down
6 changes: 3 additions & 3 deletions net/ipv6/ip6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
/* Changes
*
* Mitsuru KANDA @USAGI and
* YOSHIFUJI Hideaki @USAGI: Remove ipv6_parse_exthdrs().
* Mitsuru KANDA @USAGI and
* YOSHIFUJI Hideaki @USAGI: Remove ipv6_parse_exthdrs().
*/

#include <linux/errno.h>
Expand Down Expand Up @@ -65,7 +65,7 @@ int ip6_rcv_finish(struct sk_buff *skb)
int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{
const struct ipv6hdr *hdr;
u32 pkt_len;
u32 pkt_len;
struct inet6_dev *idev;
struct net *net = dev_net(skb->dev);

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/ip6_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
continue;

iph2 = (struct ipv6hdr *)(p->data + off);
first_word = *(__be32 *)iph ^ *(__be32 *)iph2 ;
first_word = *(__be32 *)iph ^ *(__be32 *)iph2;

/* All fields must match except length and Traffic Class.
* XXX skbs on the gro_list have all been parsed and pulled
Expand Down
Loading

0 comments on commit 67ba415

Please sign in to comment.