Commit 207ec0ab authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

ipv6: Reduce switch/case indent

Make the case labels the same indent as the switch.

git diff -w shows 80 column reflowing,
removal of a useless break after return, and moving
open brace after case instead of separate line.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4500ebf8
...@@ -959,57 +959,54 @@ static int do_rawv6_setsockopt(struct sock *sk, int level, int optname, ...@@ -959,57 +959,54 @@ static int do_rawv6_setsockopt(struct sock *sk, int level, int optname,
return -EFAULT; return -EFAULT;
switch (optname) { switch (optname) {
case IPV6_CHECKSUM: case IPV6_CHECKSUM:
if (inet_sk(sk)->inet_num == IPPROTO_ICMPV6 && if (inet_sk(sk)->inet_num == IPPROTO_ICMPV6 &&
level == IPPROTO_IPV6) { level == IPPROTO_IPV6) {
/* /*
* RFC3542 tells that IPV6_CHECKSUM socket * RFC3542 tells that IPV6_CHECKSUM socket
* option in the IPPROTO_IPV6 level is not * option in the IPPROTO_IPV6 level is not
* allowed on ICMPv6 sockets. * allowed on ICMPv6 sockets.
* If you want to set it, use IPPROTO_RAW * If you want to set it, use IPPROTO_RAW
* level IPV6_CHECKSUM socket option * level IPV6_CHECKSUM socket option
* (Linux extension). * (Linux extension).
*/ */
return -EINVAL; return -EINVAL;
} }
/* You may get strange result with a positive odd offset; /* You may get strange result with a positive odd offset;
RFC2292bis agrees with me. */ RFC2292bis agrees with me. */
if (val > 0 && (val&1)) if (val > 0 && (val&1))
return -EINVAL; return -EINVAL;
if (val < 0) { if (val < 0) {
rp->checksum = 0; rp->checksum = 0;
} else { } else {
rp->checksum = 1; rp->checksum = 1;
rp->offset = val; rp->offset = val;
} }
return 0; return 0;
break;
default: default:
return -ENOPROTOOPT; return -ENOPROTOOPT;
} }
} }
static int rawv6_setsockopt(struct sock *sk, int level, int optname, static int rawv6_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen) char __user *optval, unsigned int optlen)
{ {
switch(level) { switch (level) {
case SOL_RAW: case SOL_RAW:
break; break;
case SOL_ICMPV6: case SOL_ICMPV6:
if (inet_sk(sk)->inet_num != IPPROTO_ICMPV6) if (inet_sk(sk)->inet_num != IPPROTO_ICMPV6)
return -EOPNOTSUPP; return -EOPNOTSUPP;
return rawv6_seticmpfilter(sk, level, optname, optval, return rawv6_seticmpfilter(sk, level, optname, optval, optlen);
optlen); case SOL_IPV6:
case SOL_IPV6: if (optname == IPV6_CHECKSUM)
if (optname == IPV6_CHECKSUM) break;
break; default:
default: return ipv6_setsockopt(sk, level, optname, optval, optlen);
return ipv6_setsockopt(sk, level, optname, optval,
optlen);
} }
return do_rawv6_setsockopt(sk, level, optname, optval, optlen); return do_rawv6_setsockopt(sk, level, optname, optval, optlen);
...@@ -1075,21 +1072,19 @@ static int do_rawv6_getsockopt(struct sock *sk, int level, int optname, ...@@ -1075,21 +1072,19 @@ static int do_rawv6_getsockopt(struct sock *sk, int level, int optname,
static int rawv6_getsockopt(struct sock *sk, int level, int optname, static int rawv6_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen) char __user *optval, int __user *optlen)
{ {
switch(level) { switch (level) {
case SOL_RAW: case SOL_RAW:
break; break;
case SOL_ICMPV6: case SOL_ICMPV6:
if (inet_sk(sk)->inet_num != IPPROTO_ICMPV6) if (inet_sk(sk)->inet_num != IPPROTO_ICMPV6)
return -EOPNOTSUPP; return -EOPNOTSUPP;
return rawv6_geticmpfilter(sk, level, optname, optval, return rawv6_geticmpfilter(sk, level, optname, optval, optlen);
optlen); case SOL_IPV6:
case SOL_IPV6: if (optname == IPV6_CHECKSUM)
if (optname == IPV6_CHECKSUM) break;
break; default:
default: return ipv6_getsockopt(sk, level, optname, optval, optlen);
return ipv6_getsockopt(sk, level, optname, optval,
optlen);
} }
return do_rawv6_getsockopt(sk, level, optname, optval, optlen); return do_rawv6_getsockopt(sk, level, optname, optval, optlen);
...@@ -1119,31 +1114,29 @@ static int compat_rawv6_getsockopt(struct sock *sk, int level, int optname, ...@@ -1119,31 +1114,29 @@ static int compat_rawv6_getsockopt(struct sock *sk, int level, int optname,
static int rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg) static int rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg)
{ {
switch(cmd) { switch (cmd) {
case SIOCOUTQ: case SIOCOUTQ: {
{ int amount = sk_wmem_alloc_get(sk);
int amount = sk_wmem_alloc_get(sk);
return put_user(amount, (int __user *)arg); return put_user(amount, (int __user *)arg);
} }
case SIOCINQ: case SIOCINQ: {
{ struct sk_buff *skb;
struct sk_buff *skb; int amount = 0;
int amount = 0;
spin_lock_bh(&sk->sk_receive_queue.lock);
spin_lock_bh(&sk->sk_receive_queue.lock); skb = skb_peek(&sk->sk_receive_queue);
skb = skb_peek(&sk->sk_receive_queue); if (skb != NULL)
if (skb != NULL) amount = skb->tail - skb->transport_header;
amount = skb->tail - skb->transport_header; spin_unlock_bh(&sk->sk_receive_queue.lock);
spin_unlock_bh(&sk->sk_receive_queue.lock); return put_user(amount, (int __user *)arg);
return put_user(amount, (int __user *)arg); }
}
default: default:
#ifdef CONFIG_IPV6_MROUTE #ifdef CONFIG_IPV6_MROUTE
return ip6mr_ioctl(sk, cmd, (void __user *)arg); return ip6mr_ioctl(sk, cmd, (void __user *)arg);
#else #else
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
#endif #endif
} }
} }
......
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