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; *buf++ = type;
switch(type) { switch (type) {
case 0: case 0:
*buf++ = sdn->sdn_objnum; *buf++ = sdn->sdn_objnum;
break; break;
@ -337,7 +337,7 @@ int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *sdn,
*fmt = *data++; *fmt = *data++;
type = *data++; type = *data++;
switch(*fmt) { switch (*fmt) {
case 0: case 0:
sdn->sdn_objnum = type; sdn->sdn_objnum = type;
return 2; return 2;
@ -575,7 +575,7 @@ int dn_destroy_timer(struct sock *sk)
scp->persist = dn_nsp_persist(sk); scp->persist = dn_nsp_persist(sk);
switch(scp->state) { switch (scp->state) {
case DN_DI: case DN_DI:
dn_nsp_send_disc(sk, NSP_DISCINIT, 0, GFP_ATOMIC); dn_nsp_send_disc(sk, NSP_DISCINIT, 0, GFP_ATOMIC);
if (scp->nsp_rxtshift >= decnet_di_count) if (scp->nsp_rxtshift >= decnet_di_count)
@ -591,7 +591,8 @@ int dn_destroy_timer(struct sock *sk)
case DN_DN: case DN_DN:
if (scp->nsp_rxtshift < decnet_dn_count) { if (scp->nsp_rxtshift < decnet_dn_count) {
/* printk(KERN_DEBUG "dn_destroy_timer: DN\n"); */ /* 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; return 0;
} }
} }
@ -623,7 +624,7 @@ static void dn_destroy_sock(struct sock *sk)
sk->sk_state = TCP_CLOSE; sk->sk_state = TCP_CLOSE;
switch(scp->state) { switch (scp->state) {
case DN_DN: case DN_DN:
dn_nsp_send_disc(sk, NSP_DISCCONF, NSP_REASON_DC, dn_nsp_send_disc(sk, NSP_DISCCONF, NSP_REASON_DC,
sk->sk_allocation); 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)) if (!net_eq(net, &init_net))
return -EAFNOSUPPORT; return -EAFNOSUPPORT;
switch(sock->type) { switch (sock->type) {
case SOCK_SEQPACKET: case SOCK_SEQPACKET:
if (protocol != DNPROTO_NSP) if (protocol != DNPROTO_NSP)
return -EPROTONOSUPPORT; 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); struct dn_scp *scp = DN_SK(sk);
switch(scp->state) { switch (scp->state) {
case DN_RUN: case DN_RUN:
return 0; return 0;
case DN_CR: 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)) if (copy_from_user(&u, optval, optlen))
return -EFAULT; return -EFAULT;
switch(optname) { switch (optname) {
case DSO_CONDATA: case DSO_CONDATA:
if (sock->state == SS_CONNECTED) if (sock->state == SS_CONNECTED)
return -EISCONN; return -EISCONN;
@ -1380,7 +1381,8 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
break; break;
case DSO_DISDATA: 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; return -ENOTCONN;
if (optlen != sizeof(struct optdata_dn)) if (optlen != sizeof(struct optdata_dn))
@ -1425,7 +1427,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
break; break;
case DSO_CONACCEPT: case DSO_CONACCEPT:
if (scp->state != DN_CR) if (scp->state != DN_CR)
return -EINVAL; return -EINVAL;
timeo = sock_rcvtimeo(sk, 0); timeo = sock_rcvtimeo(sk, 0);
@ -1433,7 +1434,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
return err; return err;
case DSO_CONREJECT: case DSO_CONREJECT:
if (scp->state != DN_CR) if (scp->state != DN_CR)
return -EINVAL; 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)) if(get_user(r_len , optlen))
return -EFAULT; return -EFAULT;
switch(optname) { switch (optname) {
case DSO_CONDATA: case DSO_CONDATA:
if (r_len > sizeof(struct optdata_dn)) if (r_len > sizeof(struct optdata_dn))
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)); memset(&link, 0, sizeof(link));
switch(sock->state) { switch (sock->state) {
case SS_CONNECTING: case SS_CONNECTING:
link.idn_linkstate = LL_CONNECTING; link.idn_linkstate = LL_CONNECTING;
break; break;
@ -1581,11 +1581,10 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
{ {
int ret, len; int ret, len;
if(get_user(len, optlen)) if (get_user(len, optlen))
return -EFAULT; return -EFAULT;
ret = nf_getsockopt(sk, PF_DECnet, optname, ret = nf_getsockopt(sk, PF_DECnet, optname, optval, &len);
optval, &len);
if (ret >= 0) if (ret >= 0)
ret = put_user(len, optlen); ret = put_user(len, optlen);
return ret; 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)) if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE; return NOTIFY_DONE;
switch(event) { switch (event) {
case NETDEV_UP: case NETDEV_UP:
dn_dev_up(dev); dn_dev_up(dev);
break; break;
@ -2224,7 +2223,7 @@ static void dn_printable_object(struct sockaddr_dn *dn, unsigned char *buf)
static char *dn_state2asc(unsigned char state) static char *dn_state2asc(unsigned char state)
{ {
switch(state) { switch (state) {
case DN_O: case DN_O:
return "OPEN"; return "OPEN";
case DN_CR: 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); dev_load(&init_net, ifr->ifr_name);
switch(cmd) { switch (cmd) {
case SIOCGIFADDR: case SIOCGIFADDR:
break; break;
case SIOCSIFADDR: case SIOCSIFADDR:
@ -470,7 +470,7 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
goto done; goto done;
} }
switch(cmd) { switch (cmd) {
case SIOCGIFADDR: case SIOCGIFADDR:
*((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local; *((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local;
goto rarok; goto rarok;
@ -1335,7 +1335,7 @@ static void dn_dev_seq_stop(struct seq_file *seq, void *v)
static char *dn_type2asc(char type) static char *dn_type2asc(char type)
{ {
switch(type) { switch (type) {
case DN_DEV_BCAST: case DN_DEV_BCAST:
return "B"; return "B";
case DN_DEV_UCAST: 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; res->fi = fi;
switch(type) { switch (type) {
case RTN_NAT: case RTN_NAT:
DN_FIB_RES_RESET(*res); DN_FIB_RES_RESET(*res);
atomic_inc(&fi->fib_clntref); 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; return 1;
default: default:
if (net_ratelimit()) 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; res->fi = NULL;
return -EINVAL; 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; struct dn_ifaddr *ifa = (struct dn_ifaddr *)ptr;
switch(event) { switch (event) {
case NETDEV_UP: case NETDEV_UP:
dn_fib_add_ifaddr(ifa); dn_fib_add_ifaddr(ifa);
dn_fib_sync_up(ifa->ifa_dev->dev); 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; dn->flags &= ~DN_NDFLAG_P3;
switch(msg->iinfo & DN_RT_INFO_TYPE) { switch (msg->iinfo & DN_RT_INFO_TYPE) {
case DN_RT_INFO_L1RT: case DN_RT_INFO_L1RT:
dn->flags &=~DN_NDFLAG_R2; dn->flags &=~DN_NDFLAG_R2;
dn->flags |= DN_NDFLAG_R1; 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); unsigned short type = ((ack >> 12) & 0x0003);
int wakeup = 0; int wakeup = 0;
switch(type) { switch (type) {
case 0: /* ACK - Data */ case 0: /* ACK - Data */
if (dn_after(ack, scp->ackrcv_dat)) { if (dn_after(ack, scp->ackrcv_dat)) {
scp->ackrcv_dat = ack & 0x0fff; 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; break;
case 1: /* NAK - Data */ 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 */ case 2: /* ACK - OtherData */
if (dn_after(ack, scp->ackrcv_oth)) { if (dn_after(ack, scp->ackrcv_oth)) {
scp->ackrcv_oth = ack & 0x0fff; 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; break;
case 3: /* NAK - OtherData */ 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; scp->addrrem = cb->src_port;
sk->sk_state = TCP_CLOSE; sk->sk_state = TCP_CLOSE;
switch(scp->state) { switch (scp->state) {
case DN_CI: case DN_CI:
case DN_CD: case DN_CD:
scp->state = DN_RJ; 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; sk->sk_state = TCP_CLOSE;
switch(scp->state) { switch (scp->state) {
case DN_CI: case DN_CI:
scp->state = DN_NR; scp->state = DN_NR;
break; break;
@ -692,7 +696,7 @@ static int dn_nsp_no_socket(struct sk_buff *skb, unsigned short reason)
goto out; goto out;
if ((reason != NSP_REASON_OK) && ((cb->nsp_flags & 0x0c) == 0x08)) { if ((reason != NSP_REASON_OK) && ((cb->nsp_flags & 0x0c) == 0x08)) {
switch(cb->nsp_flags & 0x70) { switch (cb->nsp_flags & 0x70) {
case 0x10: case 0x10:
case 0x60: /* (Retransmitted) Connect Init */ case 0x60: /* (Retransmitted) Connect Init */
dn_nsp_return_disc(skb, NSP_DISCINIT, reason); 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 * Filter out conninits and useless packet types
*/ */
if ((cb->nsp_flags & 0x0c) == 0x08) { if ((cb->nsp_flags & 0x0c) == 0x08) {
switch(cb->nsp_flags & 0x70) { switch (cb->nsp_flags & 0x70) {
case 0x00: /* NOP */ case 0x00: /* NOP */
case 0x70: /* Reserved */ case 0x70: /* Reserved */
case 0x50: /* Reserved, Phase II node init */ 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. * Control packet.
*/ */
if ((cb->nsp_flags & 0x0c) == 0x08) { if ((cb->nsp_flags & 0x0c) == 0x08) {
switch(cb->nsp_flags & 0x70) { switch (cb->nsp_flags & 0x70) {
case 0x10: case 0x10:
case 0x60: case 0x60:
dn_nsp_conn_init(sk, skb); 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) if (scp->state != DN_RUN)
goto free_out; goto free_out;
switch(cb->nsp_flags) { switch (cb->nsp_flags) {
case 0x10: /* LS */ case 0x10: /* LS */
dn_nsp_linkservice(sk, skb); dn_nsp_linkservice(sk, skb);
break; 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)) { 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: case DN_RT_PKT_SHORT:
return dn_return_short(skb); return dn_return_short(skb);
case DN_RT_PKT_LONG: 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))) if (unlikely(skb_linearize(skb)))
goto dump_it; goto dump_it;
switch(flags & DN_RT_CNTL_MSK) { switch (flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_INIT: case DN_RT_PKT_INIT:
dn_dev_init_pkt(skb); dn_dev_init_pkt(skb);
break; 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) if (dn->parms.state != DN_DEV_S_RU)
goto dump_it; goto dump_it;
switch(flags & DN_RT_CNTL_MSK) { switch (flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_HELO: case DN_RT_PKT_HELO:
return NF_HOOK(NFPROTO_DECNET, NF_DN_HELLO, return NF_HOOK(NFPROTO_DECNET, NF_DN_HELLO,
skb, skb->dev, NULL, 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 */ skb_pull(skb, 1); /* Pull flags */
switch(flags & DN_RT_PKT_MSK) { switch (flags & DN_RT_PKT_MSK) {
case DN_RT_PKT_LONG: case DN_RT_PKT_LONG:
return dn_route_rx_long(skb); return dn_route_rx_long(skb);
case DN_RT_PKT_SHORT: case DN_RT_PKT_SHORT:
@ -1419,7 +1419,7 @@ make_route:
rt->dst.neighbour = neigh; rt->dst.neighbour = neigh;
rt->dst.lastuse = jiffies; rt->dst.lastuse = jiffies;
rt->dst.output = dn_rt_bug; rt->dst.output = dn_rt_bug;
switch(res.type) { switch (res.type) {
case RTN_UNICAST: case RTN_UNICAST:
rt->dst.input = dn_forward; rt->dst.input = dn_forward;
break; break;

View File

@ -147,13 +147,14 @@ static void dn_rehash_zone(struct dn_zone *dz)
old_divisor = dz->dz_divisor; old_divisor = dz->dz_divisor;
switch(old_divisor) { switch (old_divisor) {
case 16: case 16:
new_divisor = 256; new_divisor = 256;
new_hashmask = 0xFF; new_hashmask = 0xFF;
break; break;
default: 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: case 256:
new_divisor = 1024; new_divisor = 1024;
new_hashmask = 0x3FF; new_hashmask = 0x3FF;

View File

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

View File

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