decnet: Reduce switch/case indent

Make the case labels the same indent as the switch.

git diff -w shows differences for line wrapping.
(fit multiple lines to 80 columns, join where possible)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Joe Perches 2011-07-01 09:43:03 +00:00 committed by David S. Miller
parent 4a9e4b0932
commit 06f8fe11bb
9 changed files with 604 additions and 598 deletions

View File

@ -291,7 +291,7 @@ int dn_sockaddr2username(struct sockaddr_dn *sdn, unsigned char *buf, unsigned c
*buf++ = type;
switch(type) {
switch (type) {
case 0:
*buf++ = sdn->sdn_objnum;
break;
@ -337,7 +337,7 @@ int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *sdn,
*fmt = *data++;
type = *data++;
switch(*fmt) {
switch (*fmt) {
case 0:
sdn->sdn_objnum = type;
return 2;
@ -575,7 +575,7 @@ int dn_destroy_timer(struct sock *sk)
scp->persist = dn_nsp_persist(sk);
switch(scp->state) {
switch (scp->state) {
case DN_DI:
dn_nsp_send_disc(sk, NSP_DISCINIT, 0, GFP_ATOMIC);
if (scp->nsp_rxtshift >= decnet_di_count)
@ -591,7 +591,8 @@ int dn_destroy_timer(struct sock *sk)
case DN_DN:
if (scp->nsp_rxtshift < decnet_dn_count) {
/* printk(KERN_DEBUG "dn_destroy_timer: DN\n"); */
dn_nsp_send_disc(sk, NSP_DISCCONF, NSP_REASON_DC, GFP_ATOMIC);
dn_nsp_send_disc(sk, NSP_DISCCONF, NSP_REASON_DC,
GFP_ATOMIC);
return 0;
}
}
@ -623,7 +624,7 @@ static void dn_destroy_sock(struct sock *sk)
sk->sk_state = TCP_CLOSE;
switch(scp->state) {
switch (scp->state) {
case DN_DN:
dn_nsp_send_disc(sk, NSP_DISCCONF, NSP_REASON_DC,
sk->sk_allocation);
@ -683,7 +684,7 @@ static int dn_create(struct net *net, struct socket *sock, int protocol,
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;
switch(sock->type) {
switch (sock->type) {
case SOCK_SEQPACKET:
if (protocol != DNPROTO_NSP)
return -EPROTONOSUPPORT;
@ -987,7 +988,7 @@ static inline int dn_check_state(struct sock *sk, struct sockaddr_dn *addr, int
{
struct dn_scp *scp = DN_SK(sk);
switch(scp->state) {
switch (scp->state) {
case DN_RUN:
return 0;
case DN_CR:
@ -1363,7 +1364,7 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
if (copy_from_user(&u, optval, optlen))
return -EFAULT;
switch(optname) {
switch (optname) {
case DSO_CONDATA:
if (sock->state == SS_CONNECTED)
return -EISCONN;
@ -1380,7 +1381,8 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
break;
case DSO_DISDATA:
if (sock->state != SS_CONNECTED && scp->accept_mode == ACC_IMMED)
if (sock->state != SS_CONNECTED &&
scp->accept_mode == ACC_IMMED)
return -ENOTCONN;
if (optlen != sizeof(struct optdata_dn))
@ -1425,7 +1427,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
break;
case DSO_CONACCEPT:
if (scp->state != DN_CR)
return -EINVAL;
timeo = sock_rcvtimeo(sk, 0);
@ -1433,7 +1434,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
return err;
case DSO_CONREJECT:
if (scp->state != DN_CR)
return -EINVAL;
@ -1527,7 +1527,7 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
if(get_user(r_len , optlen))
return -EFAULT;
switch(optname) {
switch (optname) {
case DSO_CONDATA:
if (r_len > sizeof(struct optdata_dn))
r_len = sizeof(struct optdata_dn);
@ -1558,7 +1558,7 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
memset(&link, 0, sizeof(link));
switch(sock->state) {
switch (sock->state) {
case SS_CONNECTING:
link.idn_linkstate = LL_CONNECTING;
break;
@ -1581,11 +1581,10 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
{
int ret, len;
if(get_user(len, optlen))
if (get_user(len, optlen))
return -EFAULT;
ret = nf_getsockopt(sk, PF_DECnet, optname,
optval, &len);
ret = nf_getsockopt(sk, PF_DECnet, optname, optval, &len);
if (ret >= 0)
ret = put_user(len, optlen);
return ret;
@ -2088,7 +2087,7 @@ static int dn_device_event(struct notifier_block *this, unsigned long event,
if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;
switch(event) {
switch (event) {
case NETDEV_UP:
dn_dev_up(dev);
break;
@ -2224,7 +2223,7 @@ static void dn_printable_object(struct sockaddr_dn *dn, unsigned char *buf)
static char *dn_state2asc(unsigned char state)
{
switch(state) {
switch (state) {
case DN_O:
return "OPEN";
case DN_CR:

View File

@ -437,7 +437,7 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
dev_load(&init_net, ifr->ifr_name);
switch(cmd) {
switch (cmd) {
case SIOCGIFADDR:
break;
case SIOCSIFADDR:
@ -470,7 +470,7 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
goto done;
}
switch(cmd) {
switch (cmd) {
case SIOCGIFADDR:
*((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local;
goto rarok;
@ -1335,7 +1335,7 @@ static void dn_dev_seq_stop(struct seq_file *seq, void *v)
static char *dn_type2asc(char type)
{
switch(type) {
switch (type) {
case DN_DEV_BCAST:
return "B";
case DN_DEV_UCAST:

View File

@ -414,7 +414,7 @@ int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowidn
res->fi = fi;
switch(type) {
switch (type) {
case RTN_NAT:
DN_FIB_RES_RESET(*res);
atomic_inc(&fi->fib_clntref);
@ -438,7 +438,8 @@ int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowidn
return 1;
default:
if (net_ratelimit())
printk("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n", type);
printk("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n",
type);
res->fi = NULL;
return -EINVAL;
}
@ -647,7 +648,7 @@ static int dn_fib_dnaddr_event(struct notifier_block *this, unsigned long event,
{
struct dn_ifaddr *ifa = (struct dn_ifaddr *)ptr;
switch(event) {
switch (event) {
case NETDEV_UP:
dn_fib_add_ifaddr(ifa);
dn_fib_sync_up(ifa->ifa_dev->dev);

View File

@ -404,7 +404,7 @@ int dn_neigh_router_hello(struct sk_buff *skb)
dn->flags &= ~DN_NDFLAG_P3;
switch(msg->iinfo & DN_RT_INFO_TYPE) {
switch (msg->iinfo & DN_RT_INFO_TYPE) {
case DN_RT_INFO_L1RT:
dn->flags &=~DN_NDFLAG_R2;
dn->flags |= DN_NDFLAG_R1;

View File

@ -101,11 +101,13 @@ static void dn_ack(struct sock *sk, struct sk_buff *skb, unsigned short ack)
unsigned short type = ((ack >> 12) & 0x0003);
int wakeup = 0;
switch(type) {
switch (type) {
case 0: /* ACK - Data */
if (dn_after(ack, scp->ackrcv_dat)) {
scp->ackrcv_dat = ack & 0x0fff;
wakeup |= dn_nsp_check_xmit_queue(sk, skb, &scp->data_xmit_queue, ack);
wakeup |= dn_nsp_check_xmit_queue(sk, skb,
&scp->data_xmit_queue,
ack);
}
break;
case 1: /* NAK - Data */
@ -113,7 +115,9 @@ static void dn_ack(struct sock *sk, struct sk_buff *skb, unsigned short ack)
case 2: /* ACK - OtherData */
if (dn_after(ack, scp->ackrcv_oth)) {
scp->ackrcv_oth = ack & 0x0fff;
wakeup |= dn_nsp_check_xmit_queue(sk, skb, &scp->other_xmit_queue, ack);
wakeup |= dn_nsp_check_xmit_queue(sk, skb,
&scp->other_xmit_queue,
ack);
}
break;
case 3: /* NAK - OtherData */
@ -417,7 +421,7 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb)
scp->addrrem = cb->src_port;
sk->sk_state = TCP_CLOSE;
switch(scp->state) {
switch (scp->state) {
case DN_CI:
case DN_CD:
scp->state = DN_RJ;
@ -470,7 +474,7 @@ static void dn_nsp_disc_conf(struct sock *sk, struct sk_buff *skb)
sk->sk_state = TCP_CLOSE;
switch(scp->state) {
switch (scp->state) {
case DN_CI:
scp->state = DN_NR;
break;
@ -692,7 +696,7 @@ static int dn_nsp_no_socket(struct sk_buff *skb, unsigned short reason)
goto out;
if ((reason != NSP_REASON_OK) && ((cb->nsp_flags & 0x0c) == 0x08)) {
switch(cb->nsp_flags & 0x70) {
switch (cb->nsp_flags & 0x70) {
case 0x10:
case 0x60: /* (Retransmitted) Connect Init */
dn_nsp_return_disc(skb, NSP_DISCINIT, reason);
@ -733,7 +737,7 @@ static int dn_nsp_rx_packet(struct sk_buff *skb)
* Filter out conninits and useless packet types
*/
if ((cb->nsp_flags & 0x0c) == 0x08) {
switch(cb->nsp_flags & 0x70) {
switch (cb->nsp_flags & 0x70) {
case 0x00: /* NOP */
case 0x70: /* Reserved */
case 0x50: /* Reserved, Phase II node init */
@ -836,7 +840,7 @@ int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
* Control packet.
*/
if ((cb->nsp_flags & 0x0c) == 0x08) {
switch(cb->nsp_flags & 0x70) {
switch (cb->nsp_flags & 0x70) {
case 0x10:
case 0x60:
dn_nsp_conn_init(sk, skb);
@ -890,7 +894,7 @@ int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
if (scp->state != DN_RUN)
goto free_out;
switch(cb->nsp_flags) {
switch (cb->nsp_flags) {
case 0x10: /* LS */
dn_nsp_linkservice(sk, skb);
break;

View File

@ -495,7 +495,7 @@ static int dn_route_rx_packet(struct sk_buff *skb)
}
if ((skb->pkt_type == PACKET_HOST) && (cb->rt_flags & DN_RT_F_RQR)) {
switch(cb->rt_flags & DN_RT_PKT_MSK) {
switch (cb->rt_flags & DN_RT_PKT_MSK) {
case DN_RT_PKT_SHORT:
return dn_return_short(skb);
case DN_RT_PKT_LONG:
@ -652,7 +652,7 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
if (unlikely(skb_linearize(skb)))
goto dump_it;
switch(flags & DN_RT_CNTL_MSK) {
switch (flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_INIT:
dn_dev_init_pkt(skb);
break;
@ -664,7 +664,7 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
if (dn->parms.state != DN_DEV_S_RU)
goto dump_it;
switch(flags & DN_RT_CNTL_MSK) {
switch (flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_HELO:
return NF_HOOK(NFPROTO_DECNET, NF_DN_HELLO,
skb, skb->dev, NULL,
@ -691,7 +691,7 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
skb_pull(skb, 1); /* Pull flags */
switch(flags & DN_RT_PKT_MSK) {
switch (flags & DN_RT_PKT_MSK) {
case DN_RT_PKT_LONG:
return dn_route_rx_long(skb);
case DN_RT_PKT_SHORT:
@ -1419,7 +1419,7 @@ make_route:
rt->dst.neighbour = neigh;
rt->dst.lastuse = jiffies;
rt->dst.output = dn_rt_bug;
switch(res.type) {
switch (res.type) {
case RTN_UNICAST:
rt->dst.input = dn_forward;
break;

View File

@ -147,13 +147,14 @@ static void dn_rehash_zone(struct dn_zone *dz)
old_divisor = dz->dz_divisor;
switch(old_divisor) {
switch (old_divisor) {
case 16:
new_divisor = 256;
new_hashmask = 0xFF;
break;
default:
printk(KERN_DEBUG "DECnet: dn_rehash_zone: BUG! %d\n", old_divisor);
printk(KERN_DEBUG "DECnet: dn_rehash_zone: BUG! %d\n",
old_divisor);
case 256:
new_divisor = 1024;
new_hashmask = 0x3FF;

View File

@ -69,7 +69,7 @@ static void dnrmg_send_peer(struct sk_buff *skb)
int group = 0;
unsigned char flags = *skb->data;
switch(flags & DN_RT_CNTL_MSK) {
switch (flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_L1RT:
group = DNRNG_NLGRP_L1;
break;

View File

@ -68,12 +68,13 @@ static struct ctl_table_header *dn_table_header = NULL;
static void strip_it(char *str)
{
for(;;) {
switch(*str) {
switch (*str) {
case ' ':
case '\n':
case '\r':
case ':':
*str = 0;
/* Fallthrough */
case 0:
return;
}