Commit e71a4783 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NET] core: whitespace cleanup

Fix whitespace around keywords. Fix indentation especially of switch
statements.
Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent add459aa
...@@ -34,11 +34,11 @@ static inline int iov_from_user_compat_to_kern(struct iovec *kiov, ...@@ -34,11 +34,11 @@ static inline int iov_from_user_compat_to_kern(struct iovec *kiov,
{ {
int tot_len = 0; int tot_len = 0;
while(niov > 0) { while (niov > 0) {
compat_uptr_t buf; compat_uptr_t buf;
compat_size_t len; compat_size_t len;
if(get_user(len, &uiov32->iov_len) || if (get_user(len, &uiov32->iov_len) ||
get_user(buf, &uiov32->iov_base)) { get_user(buf, &uiov32->iov_base)) {
tot_len = -EFAULT; tot_len = -EFAULT;
break; break;
...@@ -78,12 +78,12 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov, ...@@ -78,12 +78,12 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
{ {
int tot_len; int tot_len;
if(kern_msg->msg_namelen) { if (kern_msg->msg_namelen) {
if(mode==VERIFY_READ) { if (mode==VERIFY_READ) {
int err = move_addr_to_kernel(kern_msg->msg_name, int err = move_addr_to_kernel(kern_msg->msg_name,
kern_msg->msg_namelen, kern_msg->msg_namelen,
kern_address); kern_address);
if(err < 0) if (err < 0)
return err; return err;
} }
kern_msg->msg_name = kern_address; kern_msg->msg_name = kern_address;
...@@ -93,7 +93,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov, ...@@ -93,7 +93,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
tot_len = iov_from_user_compat_to_kern(kern_iov, tot_len = iov_from_user_compat_to_kern(kern_iov,
(struct compat_iovec __user *)kern_msg->msg_iov, (struct compat_iovec __user *)kern_msg->msg_iov,
kern_msg->msg_iovlen); kern_msg->msg_iovlen);
if(tot_len >= 0) if (tot_len >= 0)
kern_msg->msg_iov = kern_iov; kern_msg->msg_iov = kern_iov;
return tot_len; return tot_len;
...@@ -146,8 +146,8 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, ...@@ -146,8 +146,8 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
kcmlen = 0; kcmlen = 0;
kcmsg_base = kcmsg = (struct cmsghdr *)stackbuf; kcmsg_base = kcmsg = (struct cmsghdr *)stackbuf;
ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg);
while(ucmsg != NULL) { while (ucmsg != NULL) {
if(get_user(ucmlen, &ucmsg->cmsg_len)) if (get_user(ucmlen, &ucmsg->cmsg_len))
return -EFAULT; return -EFAULT;
/* Catch bogons. */ /* Catch bogons. */
...@@ -160,7 +160,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, ...@@ -160,7 +160,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
kcmlen += tmp; kcmlen += tmp;
ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen);
} }
if(kcmlen == 0) if (kcmlen == 0)
return -EINVAL; return -EINVAL;
/* The kcmlen holds the 64-bit version of the control length. /* The kcmlen holds the 64-bit version of the control length.
...@@ -176,7 +176,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, ...@@ -176,7 +176,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
/* Now copy them over neatly. */ /* Now copy them over neatly. */
memset(kcmsg, 0, kcmlen); memset(kcmsg, 0, kcmlen);
ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg);
while(ucmsg != NULL) { while (ucmsg != NULL) {
if (__get_user(ucmlen, &ucmsg->cmsg_len)) if (__get_user(ucmlen, &ucmsg->cmsg_len))
goto Efault; goto Efault;
if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg)) if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg))
...@@ -219,7 +219,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat ...@@ -219,7 +219,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
struct compat_cmsghdr cmhdr; struct compat_cmsghdr cmhdr;
int cmlen; int cmlen;
if(cm == NULL || kmsg->msg_controllen < sizeof(*cm)) { if (cm == NULL || kmsg->msg_controllen < sizeof(*cm)) {
kmsg->msg_flags |= MSG_CTRUNC; kmsg->msg_flags |= MSG_CTRUNC;
return 0; /* XXX: return error? check spec. */ return 0; /* XXX: return error? check spec. */
} }
...@@ -233,7 +233,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat ...@@ -233,7 +233,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
} }
cmlen = CMSG_COMPAT_LEN(len); cmlen = CMSG_COMPAT_LEN(len);
if(kmsg->msg_controllen < cmlen) { if (kmsg->msg_controllen < cmlen) {
kmsg->msg_flags |= MSG_CTRUNC; kmsg->msg_flags |= MSG_CTRUNC;
cmlen = kmsg->msg_controllen; cmlen = kmsg->msg_controllen;
} }
...@@ -241,9 +241,9 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat ...@@ -241,9 +241,9 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
cmhdr.cmsg_type = type; cmhdr.cmsg_type = type;
cmhdr.cmsg_len = cmlen; cmhdr.cmsg_len = cmlen;
if(copy_to_user(cm, &cmhdr, sizeof cmhdr)) if (copy_to_user(cm, &cmhdr, sizeof cmhdr))
return -EFAULT; return -EFAULT;
if(copy_to_user(CMSG_COMPAT_DATA(cm), data, cmlen - sizeof(struct compat_cmsghdr))) if (copy_to_user(CMSG_COMPAT_DATA(cm), data, cmlen - sizeof(struct compat_cmsghdr)))
return -EFAULT; return -EFAULT;
cmlen = CMSG_COMPAT_SPACE(len); cmlen = CMSG_COMPAT_SPACE(len);
kmsg->msg_control += cmlen; kmsg->msg_control += cmlen;
...@@ -646,7 +646,7 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args) ...@@ -646,7 +646,7 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args)
a0 = a[0]; a0 = a[0];
a1 = a[1]; a1 = a[1];
switch(call) { switch (call) {
case SYS_SOCKET: case SYS_SOCKET:
ret = sys_socket(a0, a1, a[2]); ret = sys_socket(a0, a1, a[2]);
break; break;
......
...@@ -836,7 +836,7 @@ int dev_ethtool(struct ifreq *ifr) ...@@ -836,7 +836,7 @@ int dev_ethtool(struct ifreq *ifr)
return -EPERM; return -EPERM;
} }
if(dev->ethtool_ops->begin) if (dev->ethtool_ops->begin)
if ((rc = dev->ethtool_ops->begin(dev)) < 0) if ((rc = dev->ethtool_ops->begin(dev)) < 0)
return rc; return rc;
...@@ -952,7 +952,7 @@ int dev_ethtool(struct ifreq *ifr) ...@@ -952,7 +952,7 @@ int dev_ethtool(struct ifreq *ifr)
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
} }
if(dev->ethtool_ops->complete) if (dev->ethtool_ops->complete)
dev->ethtool_ops->complete(dev); dev->ethtool_ops->complete(dev);
if (old_features != dev->features) if (old_features != dev->features)
......
...@@ -352,8 +352,8 @@ static ssize_t wireless_show(struct device *d, char *buf, ...@@ -352,8 +352,8 @@ static ssize_t wireless_show(struct device *d, char *buf,
read_lock(&dev_base_lock); read_lock(&dev_base_lock);
if (dev_isalive(dev)) { if (dev_isalive(dev)) {
if(dev->wireless_handlers && if (dev->wireless_handlers &&
dev->wireless_handlers->get_wireless_stats) dev->wireless_handlers->get_wireless_stats)
iw = dev->wireless_handlers->get_wireless_stats(dev); iw = dev->wireless_handlers->get_wireless_stats(dev);
if (iw != NULL) if (iw != NULL)
ret = (*format)(iw, buf); ret = (*format)(iw, buf);
......
...@@ -645,7 +645,7 @@ static int pktgen_if_show(struct seq_file *seq, void *v) ...@@ -645,7 +645,7 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
if (pkt_dev->nr_labels) { if (pkt_dev->nr_labels) {
unsigned i; unsigned i;
seq_printf(seq, " mpls: "); seq_printf(seq, " mpls: ");
for(i = 0; i < pkt_dev->nr_labels; i++) for (i = 0; i < pkt_dev->nr_labels; i++)
seq_printf(seq, "%08x%s", ntohl(pkt_dev->labels[i]), seq_printf(seq, "%08x%s", ntohl(pkt_dev->labels[i]),
i == pkt_dev->nr_labels-1 ? "\n" : ", "); i == pkt_dev->nr_labels-1 ? "\n" : ", ");
} }
...@@ -750,7 +750,7 @@ static int hex32_arg(const char __user *user_buffer, unsigned long maxlen, __u32 ...@@ -750,7 +750,7 @@ static int hex32_arg(const char __user *user_buffer, unsigned long maxlen, __u32
int i = 0; int i = 0;
*num = 0; *num = 0;
for(; i < maxlen; i++) { for (; i < maxlen; i++) {
char c; char c;
*num <<= 4; *num <<= 4;
if (get_user(c, &user_buffer[i])) if (get_user(c, &user_buffer[i]))
...@@ -858,7 +858,7 @@ static ssize_t get_labels(const char __user *buffer, struct pktgen_dev *pkt_dev) ...@@ -858,7 +858,7 @@ static ssize_t get_labels(const char __user *buffer, struct pktgen_dev *pkt_dev)
n++; n++;
if (n >= MAX_MPLS_LABELS) if (n >= MAX_MPLS_LABELS)
return -E2BIG; return -E2BIG;
} while(c == ','); } while (c == ',');
pkt_dev->nr_labels = n; pkt_dev->nr_labels = n;
return i; return i;
...@@ -1487,7 +1487,7 @@ static ssize_t pktgen_if_write(struct file *file, ...@@ -1487,7 +1487,7 @@ static ssize_t pktgen_if_write(struct file *file,
if (len < 0) { return len; } if (len < 0) { return len; }
i += len; i += len;
offset = sprintf(pg_result, "OK: mpls="); offset = sprintf(pg_result, "OK: mpls=");
for(n = 0; n < pkt_dev->nr_labels; n++) for (n = 0; n < pkt_dev->nr_labels; n++)
offset += sprintf(pg_result + offset, offset += sprintf(pg_result + offset,
"%08x%s", ntohl(pkt_dev->labels[n]), "%08x%s", ntohl(pkt_dev->labels[n]),
n == pkt_dev->nr_labels-1 ? "" : ","); n == pkt_dev->nr_labels-1 ? "" : ",");
...@@ -2148,7 +2148,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev) ...@@ -2148,7 +2148,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
if (pkt_dev->flags & F_MPLS_RND) { if (pkt_dev->flags & F_MPLS_RND) {
unsigned i; unsigned i;
for(i = 0; i < pkt_dev->nr_labels; i++) for (i = 0; i < pkt_dev->nr_labels; i++)
if (pkt_dev->labels[i] & MPLS_STACK_BOTTOM) if (pkt_dev->labels[i] & MPLS_STACK_BOTTOM)
pkt_dev->labels[i] = MPLS_STACK_BOTTOM | pkt_dev->labels[i] = MPLS_STACK_BOTTOM |
((__force __be32)random32() & ((__force __be32)random32() &
...@@ -2281,7 +2281,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev) ...@@ -2281,7 +2281,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
static void mpls_push(__be32 *mpls, struct pktgen_dev *pkt_dev) static void mpls_push(__be32 *mpls, struct pktgen_dev *pkt_dev)
{ {
unsigned i; unsigned i;
for(i = 0; i < pkt_dev->nr_labels; i++) { for (i = 0; i < pkt_dev->nr_labels; i++) {
*mpls++ = pkt_dev->labels[i] & ~MPLS_STACK_BOTTOM; *mpls++ = pkt_dev->labels[i] & ~MPLS_STACK_BOTTOM;
} }
mpls--; mpls--;
...@@ -2341,7 +2341,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, ...@@ -2341,7 +2341,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
mpls_push(mpls, pkt_dev); mpls_push(mpls, pkt_dev);
if (pkt_dev->vlan_id != 0xffff) { if (pkt_dev->vlan_id != 0xffff) {
if(pkt_dev->svlan_id != 0xffff) { if (pkt_dev->svlan_id != 0xffff) {
svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
*svlan_tci = build_tci(pkt_dev->svlan_id, *svlan_tci = build_tci(pkt_dev->svlan_id,
pkt_dev->svlan_cfi, pkt_dev->svlan_cfi,
...@@ -2677,7 +2677,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev, ...@@ -2677,7 +2677,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
mpls_push(mpls, pkt_dev); mpls_push(mpls, pkt_dev);
if (pkt_dev->vlan_id != 0xffff) { if (pkt_dev->vlan_id != 0xffff) {
if(pkt_dev->svlan_id != 0xffff) { if (pkt_dev->svlan_id != 0xffff) {
svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
*svlan_tci = build_tci(pkt_dev->svlan_id, *svlan_tci = build_tci(pkt_dev->svlan_id,
pkt_dev->svlan_cfi, pkt_dev->svlan_cfi,
......
This diff is collapsed.
This diff is collapsed.
...@@ -1292,7 +1292,7 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) ...@@ -1292,7 +1292,7 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen)
int err, fput_needed; int err, fput_needed;
sock = sockfd_lookup_light(fd, &err, &fput_needed); sock = sockfd_lookup_light(fd, &err, &fput_needed);
if(sock) { if (sock) {
err = move_addr_to_kernel(umyaddr, addrlen, address); err = move_addr_to_kernel(umyaddr, addrlen, address);
if (err >= 0) { if (err >= 0) {
err = security_socket_bind(sock, err = security_socket_bind(sock,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment