Commit 06f8fe11 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a9e4b09
...@@ -291,23 +291,23 @@ int dn_sockaddr2username(struct sockaddr_dn *sdn, unsigned char *buf, unsigned c ...@@ -291,23 +291,23 @@ 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;
case 1: case 1:
*buf++ = 0; *buf++ = 0;
*buf++ = le16_to_cpu(sdn->sdn_objnamel); *buf++ = le16_to_cpu(sdn->sdn_objnamel);
memcpy(buf, sdn->sdn_objname, le16_to_cpu(sdn->sdn_objnamel)); memcpy(buf, sdn->sdn_objname, le16_to_cpu(sdn->sdn_objnamel));
len = 3 + le16_to_cpu(sdn->sdn_objnamel); len = 3 + le16_to_cpu(sdn->sdn_objnamel);
break; break;
case 2: case 2:
memset(buf, 0, 5); memset(buf, 0, 5);
buf += 5; buf += 5;
*buf++ = le16_to_cpu(sdn->sdn_objnamel); *buf++ = le16_to_cpu(sdn->sdn_objnamel);
memcpy(buf, sdn->sdn_objname, le16_to_cpu(sdn->sdn_objnamel)); memcpy(buf, sdn->sdn_objname, le16_to_cpu(sdn->sdn_objnamel));
len = 7 + le16_to_cpu(sdn->sdn_objnamel); len = 7 + le16_to_cpu(sdn->sdn_objnamel);
break; break;
} }
return len; return len;
...@@ -337,23 +337,23 @@ int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *sdn, ...@@ -337,23 +337,23 @@ 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;
case 1: case 1:
namel = 16; namel = 16;
break; break;
case 2: case 2:
len -= 4; len -= 4;
data += 4; data += 4;
break; break;
case 4: case 4:
len -= 8; len -= 8;
data += 8; data += 8;
break; break;
default: default:
return -1; return -1;
} }
len -= 1; len -= 1;
...@@ -575,25 +575,26 @@ int dn_destroy_timer(struct sock *sk) ...@@ -575,25 +575,26 @@ 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)
scp->state = DN_CN; scp->state = DN_CN;
return 0; return 0;
case DN_DR: case DN_DR:
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_dr_count) if (scp->nsp_rxtshift >= decnet_dr_count)
scp->state = DN_DRC; scp->state = DN_DRC;
return 0; return 0;
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,
return 0; GFP_ATOMIC);
} return 0;
}
} }
scp->persist = (HZ * decnet_time_wait); scp->persist = (HZ * decnet_time_wait);
...@@ -623,42 +624,42 @@ static void dn_destroy_sock(struct sock *sk) ...@@ -623,42 +624,42 @@ 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);
scp->persist_fxn = dn_destroy_timer; scp->persist_fxn = dn_destroy_timer;
scp->persist = dn_nsp_persist(sk); scp->persist = dn_nsp_persist(sk);
break; break;
case DN_CR: case DN_CR:
scp->state = DN_DR; scp->state = DN_DR;
goto disc_reject; goto disc_reject;
case DN_RUN: case DN_RUN:
scp->state = DN_DI; scp->state = DN_DI;
case DN_DI: case DN_DI:
case DN_DR: case DN_DR:
disc_reject: disc_reject:
dn_nsp_send_disc(sk, NSP_DISCINIT, 0, sk->sk_allocation); dn_nsp_send_disc(sk, NSP_DISCINIT, 0, sk->sk_allocation);
case DN_NC: case DN_NC:
case DN_NR: case DN_NR:
case DN_RJ: case DN_RJ:
case DN_DIC: case DN_DIC:
case DN_CN: case DN_CN:
case DN_DRC: case DN_DRC:
case DN_CI: case DN_CI:
case DN_CD: case DN_CD:
scp->persist_fxn = dn_destroy_timer; scp->persist_fxn = dn_destroy_timer;
scp->persist = dn_nsp_persist(sk); scp->persist = dn_nsp_persist(sk);
break; break;
default: default:
printk(KERN_DEBUG "DECnet: dn_destroy_sock passed socket in invalid state\n"); printk(KERN_DEBUG "DECnet: dn_destroy_sock passed socket in invalid state\n");
case DN_O: case DN_O:
dn_stop_slow_timer(sk); dn_stop_slow_timer(sk);
dn_unhash_sock_bh(sk); dn_unhash_sock_bh(sk);
sock_put(sk); sock_put(sk);
break; break;
} }
} }
...@@ -683,15 +684,15 @@ static int dn_create(struct net *net, struct socket *sock, int protocol, ...@@ -683,15 +684,15 @@ 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;
break; break;
case SOCK_STREAM: case SOCK_STREAM:
break; break;
default: default:
return -ESOCKTNOSUPPORT; return -ESOCKTNOSUPPORT;
} }
...@@ -987,16 +988,16 @@ static inline int dn_check_state(struct sock *sk, struct sockaddr_dn *addr, int ...@@ -987,16 +988,16 @@ 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:
return dn_confirm_accept(sk, timeo, sk->sk_allocation); return dn_confirm_accept(sk, timeo, sk->sk_allocation);
case DN_CI: case DN_CI:
case DN_CC: case DN_CC:
return dn_wait_run(sk, timeo); return dn_wait_run(sk, timeo);
case DN_O: case DN_O:
return __dn_connect(sk, addr, addrlen, timeo, flags); return __dn_connect(sk, addr, addrlen, timeo, flags);
} }
return -EINVAL; return -EINVAL;
...@@ -1363,141 +1364,140 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us ...@@ -1363,141 +1364,140 @@ 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;
if ((scp->state != DN_O) && (scp->state != DN_CR)) if ((scp->state != DN_O) && (scp->state != DN_CR))
return -EINVAL; return -EINVAL;
if (optlen != sizeof(struct optdata_dn)) if (optlen != sizeof(struct optdata_dn))
return -EINVAL; return -EINVAL;
if (le16_to_cpu(u.opt.opt_optl) > 16) if (le16_to_cpu(u.opt.opt_optl) > 16)
return -EINVAL; return -EINVAL;
memcpy(&scp->conndata_out, &u.opt, optlen); memcpy(&scp->conndata_out, &u.opt, optlen);
break; break;
case DSO_DISDATA:
if (sock->state != SS_CONNECTED && scp->accept_mode == ACC_IMMED)
return -ENOTCONN;
if (optlen != sizeof(struct optdata_dn))
return -EINVAL;
if (le16_to_cpu(u.opt.opt_optl) > 16) case DSO_DISDATA:
return -EINVAL; if (sock->state != SS_CONNECTED &&
scp->accept_mode == ACC_IMMED)
return -ENOTCONN;
memcpy(&scp->discdata_out, &u.opt, optlen); if (optlen != sizeof(struct optdata_dn))
break; return -EINVAL;
case DSO_CONACCESS: if (le16_to_cpu(u.opt.opt_optl) > 16)
if (sock->state == SS_CONNECTED) return -EINVAL;
return -EISCONN;
if (scp->state != DN_O)
return -EINVAL;
if (optlen != sizeof(struct accessdata_dn)) memcpy(&scp->discdata_out, &u.opt, optlen);
return -EINVAL; break;
if ((u.acc.acc_accl > DN_MAXACCL) || case DSO_CONACCESS:
(u.acc.acc_passl > DN_MAXACCL) || if (sock->state == SS_CONNECTED)
(u.acc.acc_userl > DN_MAXACCL)) return -EISCONN;
return -EINVAL; if (scp->state != DN_O)
return -EINVAL;
memcpy(&scp->accessdata, &u.acc, optlen); if (optlen != sizeof(struct accessdata_dn))
break; return -EINVAL;
case DSO_ACCEPTMODE: if ((u.acc.acc_accl > DN_MAXACCL) ||
if (sock->state == SS_CONNECTED) (u.acc.acc_passl > DN_MAXACCL) ||
return -EISCONN; (u.acc.acc_userl > DN_MAXACCL))
if (scp->state != DN_O) return -EINVAL;
return -EINVAL;
if (optlen != sizeof(int)) memcpy(&scp->accessdata, &u.acc, optlen);
return -EINVAL; break;
if ((u.mode != ACC_IMMED) && (u.mode != ACC_DEFER)) case DSO_ACCEPTMODE:
return -EINVAL; if (sock->state == SS_CONNECTED)
return -EISCONN;
if (scp->state != DN_O)
return -EINVAL;
scp->accept_mode = (unsigned char)u.mode; if (optlen != sizeof(int))
break; return -EINVAL;
case DSO_CONACCEPT: if ((u.mode != ACC_IMMED) && (u.mode != ACC_DEFER))
return -EINVAL;
if (scp->state != DN_CR) scp->accept_mode = (unsigned char)u.mode;
return -EINVAL; break;
timeo = sock_rcvtimeo(sk, 0);
err = dn_confirm_accept(sk, &timeo, sk->sk_allocation);
return err;
case DSO_CONREJECT: case DSO_CONACCEPT:
if (scp->state != DN_CR)
return -EINVAL;
timeo = sock_rcvtimeo(sk, 0);
err = dn_confirm_accept(sk, &timeo, sk->sk_allocation);
return err;
if (scp->state != DN_CR) case DSO_CONREJECT:
return -EINVAL; if (scp->state != DN_CR)
return -EINVAL;
scp->state = DN_DR; scp->state = DN_DR;
sk->sk_shutdown = SHUTDOWN_MASK; sk->sk_shutdown = SHUTDOWN_MASK;
dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation); dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation);
break; break;
default: default:
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER
return nf_setsockopt(sk, PF_DECnet, optname, optval, optlen); return nf_setsockopt(sk, PF_DECnet, optname, optval, optlen);
#endif #endif
case DSO_LINKINFO: case DSO_LINKINFO:
case DSO_STREAM: case DSO_STREAM:
case DSO_SEQPACKET: case DSO_SEQPACKET:
return -ENOPROTOOPT; return -ENOPROTOOPT;
case DSO_MAXWINDOW: case DSO_MAXWINDOW:
if (optlen != sizeof(unsigned long)) if (optlen != sizeof(unsigned long))
return -EINVAL; return -EINVAL;
if (u.win > NSP_MAX_WINDOW) if (u.win > NSP_MAX_WINDOW)
u.win = NSP_MAX_WINDOW; u.win = NSP_MAX_WINDOW;
if (u.win == 0) if (u.win == 0)
return -EINVAL; return -EINVAL;
scp->max_window = u.win; scp->max_window = u.win;
if (scp->snd_window > u.win) if (scp->snd_window > u.win)
scp->snd_window = u.win; scp->snd_window = u.win;
break; break;
case DSO_NODELAY: case DSO_NODELAY:
if (optlen != sizeof(int)) if (optlen != sizeof(int))
return -EINVAL; return -EINVAL;
if (scp->nonagle == 2) if (scp->nonagle == 2)
return -EINVAL; return -EINVAL;
scp->nonagle = (u.val == 0) ? 0 : 1; scp->nonagle = (u.val == 0) ? 0 : 1;
/* if (scp->nonagle == 1) { Push pending frames } */ /* if (scp->nonagle == 1) { Push pending frames } */
break; break;
case DSO_CORK: case DSO_CORK:
if (optlen != sizeof(int)) if (optlen != sizeof(int))
return -EINVAL; return -EINVAL;
if (scp->nonagle == 1) if (scp->nonagle == 1)
return -EINVAL; return -EINVAL;
scp->nonagle = (u.val == 0) ? 0 : 2; scp->nonagle = (u.val == 0) ? 0 : 2;
/* if (scp->nonagle == 0) { Push pending frames } */ /* if (scp->nonagle == 0) { Push pending frames } */
break; break;
case DSO_SERVICES: case DSO_SERVICES:
if (optlen != sizeof(unsigned char)) if (optlen != sizeof(unsigned char))
return -EINVAL; return -EINVAL;
if ((u.services & ~NSP_FC_MASK) != 0x01) if ((u.services & ~NSP_FC_MASK) != 0x01)
return -EINVAL; return -EINVAL;
if ((u.services & NSP_FC_MASK) == NSP_FC_MASK) if ((u.services & NSP_FC_MASK) == NSP_FC_MASK)
return -EINVAL; return -EINVAL;
scp->services_loc = u.services; scp->services_loc = u.services;
break; break;
case DSO_INFO: case DSO_INFO:
if (optlen != sizeof(unsigned char)) if (optlen != sizeof(unsigned char))
return -EINVAL; return -EINVAL;
if (u.info & 0xfc) if (u.info & 0xfc)
return -EINVAL; return -EINVAL;
scp->info_loc = u.info; scp->info_loc = u.info;
break; break;
} }
return 0; return 0;
...@@ -1527,107 +1527,106 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us ...@@ -1527,107 +1527,106 @@ 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);
r_data = &scp->conndata_in; r_data = &scp->conndata_in;
break; break;
case DSO_DISDATA:
if (r_len > sizeof(struct optdata_dn))
r_len = sizeof(struct optdata_dn);
r_data = &scp->discdata_in;
break;
case DSO_CONACCESS: case DSO_DISDATA:
if (r_len > sizeof(struct accessdata_dn)) if (r_len > sizeof(struct optdata_dn))
r_len = sizeof(struct accessdata_dn); r_len = sizeof(struct optdata_dn);
r_data = &scp->accessdata; r_data = &scp->discdata_in;
break; break;
case DSO_ACCEPTMODE: case DSO_CONACCESS:
if (r_len > sizeof(unsigned char)) if (r_len > sizeof(struct accessdata_dn))
r_len = sizeof(unsigned char); r_len = sizeof(struct accessdata_dn);
r_data = &scp->accept_mode; r_data = &scp->accessdata;
break; break;
case DSO_LINKINFO: case DSO_ACCEPTMODE:
if (r_len > sizeof(struct linkinfo_dn)) if (r_len > sizeof(unsigned char))
r_len = sizeof(struct linkinfo_dn); r_len = sizeof(unsigned char);
r_data = &scp->accept_mode;
break;
memset(&link, 0, sizeof(link)); case DSO_LINKINFO:
if (r_len > sizeof(struct linkinfo_dn))
r_len = sizeof(struct linkinfo_dn);
switch(sock->state) { memset(&link, 0, sizeof(link));
case SS_CONNECTING:
link.idn_linkstate = LL_CONNECTING;
break;
case SS_DISCONNECTING:
link.idn_linkstate = LL_DISCONNECTING;
break;
case SS_CONNECTED:
link.idn_linkstate = LL_RUNNING;
break;
default:
link.idn_linkstate = LL_INACTIVE;
}
link.idn_segsize = scp->segsize_rem; switch (sock->state) {
r_data = &link; case SS_CONNECTING:
link.idn_linkstate = LL_CONNECTING;
break;
case SS_DISCONNECTING:
link.idn_linkstate = LL_DISCONNECTING;
break;
case SS_CONNECTED:
link.idn_linkstate = LL_RUNNING;
break; break;
default: default:
link.idn_linkstate = LL_INACTIVE;
}
link.idn_segsize = scp->segsize_rem;
r_data = &link;
break;
default:
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER
{ {
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; }
}
#endif #endif
case DSO_STREAM: case DSO_STREAM:
case DSO_SEQPACKET: case DSO_SEQPACKET:
case DSO_CONACCEPT: case DSO_CONACCEPT:
case DSO_CONREJECT: case DSO_CONREJECT:
return -ENOPROTOOPT; return -ENOPROTOOPT;
case DSO_MAXWINDOW: case DSO_MAXWINDOW:
if (r_len > sizeof(unsigned long)) if (r_len > sizeof(unsigned long))
r_len = sizeof(unsigned long); r_len = sizeof(unsigned long);
r_data = &scp->max_window; r_data = &scp->max_window;
break; break;
case DSO_NODELAY: case DSO_NODELAY:
if (r_len > sizeof(int)) if (r_len > sizeof(int))
r_len = sizeof(int); r_len = sizeof(int);
val = (scp->nonagle == 1); val = (scp->nonagle == 1);
r_data = &val; r_data = &val;
break; break;
case DSO_CORK: case DSO_CORK:
if (r_len > sizeof(int)) if (r_len > sizeof(int))
r_len = sizeof(int); r_len = sizeof(int);
val = (scp->nonagle == 2); val = (scp->nonagle == 2);
r_data = &val; r_data = &val;
break; break;
case DSO_SERVICES: case DSO_SERVICES:
if (r_len > sizeof(unsigned char)) if (r_len > sizeof(unsigned char))
r_len = sizeof(unsigned char); r_len = sizeof(unsigned char);
r_data = &scp->services_rem; r_data = &scp->services_rem;
break; break;
case DSO_INFO: case DSO_INFO:
if (r_len > sizeof(unsigned char)) if (r_len > sizeof(unsigned char))
r_len = sizeof(unsigned char); r_len = sizeof(unsigned char);
r_data = &scp->info_rem; r_data = &scp->info_rem;
break; break;
} }
if (r_data) { if (r_data) {
...@@ -2088,15 +2087,15 @@ static int dn_device_event(struct notifier_block *this, unsigned long event, ...@@ -2088,15 +2087,15 @@ 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;
case NETDEV_DOWN: case NETDEV_DOWN:
dn_dev_down(dev); dn_dev_down(dev);
break; break;
default: default:
break; break;
} }
return NOTIFY_DONE; return NOTIFY_DONE;
...@@ -2209,54 +2208,54 @@ static void dn_printable_object(struct sockaddr_dn *dn, unsigned char *buf) ...@@ -2209,54 +2208,54 @@ static void dn_printable_object(struct sockaddr_dn *dn, unsigned char *buf)
int i; int i;
switch (le16_to_cpu(dn->sdn_objnamel)) { switch (le16_to_cpu(dn->sdn_objnamel)) {
case 0: case 0:
sprintf(buf, "%d", dn->sdn_objnum); sprintf(buf, "%d", dn->sdn_objnum);
break; break;
default: default:
for (i = 0; i < le16_to_cpu(dn->sdn_objnamel); i++) { for (i = 0; i < le16_to_cpu(dn->sdn_objnamel); i++) {
buf[i] = dn->sdn_objname[i]; buf[i] = dn->sdn_objname[i];
if (IS_NOT_PRINTABLE(buf[i])) if (IS_NOT_PRINTABLE(buf[i]))
buf[i] = '.'; buf[i] = '.';
} }
buf[i] = 0; buf[i] = 0;
} }
} }
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:
return " CR"; return " CR";
case DN_DR: case DN_DR:
return " DR"; return " DR";
case DN_DRC: case DN_DRC:
return " DRC"; return " DRC";
case DN_CC: case DN_CC:
return " CC"; return " CC";
case DN_CI: case DN_CI:
return " CI"; return " CI";
case DN_NR: case DN_NR:
return " NR"; return " NR";
case DN_NC: case DN_NC:
return " NC"; return " NC";
case DN_CD: case DN_CD:
return " CD"; return " CD";
case DN_RJ: case DN_RJ:
return " RJ"; return " RJ";
case DN_RUN: case DN_RUN:
return " RUN"; return " RUN";
case DN_DI: case DN_DI:
return " DI"; return " DI";
case DN_DIC: case DN_DIC:
return " DIC"; return " DIC";
case DN_DN: case DN_DN:
return " DN"; return " DN";
case DN_CL: case DN_CL:
return " CL"; return " CL";
case DN_CN: case DN_CN:
return " CN"; return " CN";
} }
return "????"; return "????";
......
...@@ -437,17 +437,17 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg) ...@@ -437,17 +437,17 @@ 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:
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EACCES; return -EACCES;
if (sdn->sdn_family != AF_DECnet) if (sdn->sdn_family != AF_DECnet)
return -EINVAL;
break;
default:
return -EINVAL; return -EINVAL;
break;
default:
return -EINVAL;
} }
rtnl_lock(); rtnl_lock();
...@@ -470,27 +470,27 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg) ...@@ -470,27 +470,27 @@ 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;
case SIOCSIFADDR: case SIOCSIFADDR:
if (!ifa) { if (!ifa) {
if ((ifa = dn_dev_alloc_ifa()) == NULL) { if ((ifa = dn_dev_alloc_ifa()) == NULL) {
ret = -ENOBUFS; ret = -ENOBUFS;
break; break;
}
memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
} else {
if (ifa->ifa_local == dn_saddr2dn(sdn))
break;
dn_dev_del_ifa(dn_db, ifap, 0);
} }
memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
} else {
if (ifa->ifa_local == dn_saddr2dn(sdn))
break;
dn_dev_del_ifa(dn_db, ifap, 0);
}
ifa->ifa_local = ifa->ifa_address = dn_saddr2dn(sdn); ifa->ifa_local = ifa->ifa_address = dn_saddr2dn(sdn);
ret = dn_dev_set_ifa(dev, ifa); ret = dn_dev_set_ifa(dev, ifa);
} }
done: done:
rtnl_unlock(); rtnl_unlock();
...@@ -1335,13 +1335,13 @@ static void dn_dev_seq_stop(struct seq_file *seq, void *v) ...@@ -1335,13 +1335,13 @@ 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:
return "U"; return "U";
case DN_DEV_MPOINT: case DN_DEV_MPOINT:
return "M"; return "M";
} }
return "?"; return "?";
......
...@@ -414,33 +414,34 @@ int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowidn ...@@ -414,33 +414,34 @@ 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);
return 0;
case RTN_UNICAST:
case RTN_LOCAL:
for_nexthops(fi) {
if (nh->nh_flags & RTNH_F_DEAD)
continue;
if (!fld->flowidn_oif ||
fld->flowidn_oif == nh->nh_oif)
break;
}
if (nhsel < fi->fib_nhs) {
res->nh_sel = nhsel;
atomic_inc(&fi->fib_clntref); atomic_inc(&fi->fib_clntref);
return 0; return 0;
case RTN_UNICAST: }
case RTN_LOCAL: endfor_nexthops(fi);
for_nexthops(fi) { res->fi = NULL;
if (nh->nh_flags & RTNH_F_DEAD) return 1;
continue; default:
if (!fld->flowidn_oif || if (net_ratelimit())
fld->flowidn_oif == nh->nh_oif) printk("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n",
break; type);
} res->fi = NULL;
if (nhsel < fi->fib_nhs) { return -EINVAL;
res->nh_sel = nhsel;
atomic_inc(&fi->fib_clntref);
return 0;
}
endfor_nexthops(fi);
res->fi = NULL;
return 1;
default:
if (net_ratelimit())
printk("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n", type);
res->fi = NULL;
return -EINVAL;
} }
} }
return err; return err;
...@@ -647,20 +648,20 @@ static int dn_fib_dnaddr_event(struct notifier_block *this, unsigned long event, ...@@ -647,20 +648,20 @@ 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);
dn_rt_cache_flush(-1);
break;
case NETDEV_DOWN:
dn_fib_del_ifaddr(ifa);
if (ifa->ifa_dev && ifa->ifa_dev->ifa_list == NULL) {
dn_fib_disable_addr(ifa->ifa_dev->dev, 1);
} else {
dn_rt_cache_flush(-1); dn_rt_cache_flush(-1);
break; }
case NETDEV_DOWN: break;
dn_fib_del_ifaddr(ifa);
if (ifa->ifa_dev && ifa->ifa_dev->ifa_list == NULL) {
dn_fib_disable_addr(ifa->ifa_dev->dev, 1);
} else {
dn_rt_cache_flush(-1);
}
break;
} }
return NOTIFY_DONE; return NOTIFY_DONE;
} }
......
...@@ -404,13 +404,13 @@ int dn_neigh_router_hello(struct sk_buff *skb) ...@@ -404,13 +404,13 @@ 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;
break; break;
case DN_RT_INFO_L2RT: case DN_RT_INFO_L2RT:
dn->flags |= DN_NDFLAG_R2; dn->flags |= DN_NDFLAG_R2;
} }
} }
......
...@@ -101,23 +101,27 @@ static void dn_ack(struct sock *sk, struct sk_buff *skb, unsigned short ack) ...@@ -101,23 +101,27 @@ 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,
break; ack);
case 1: /* NAK - Data */ }
break; break;
case 2: /* ACK - OtherData */ case 1: /* NAK - Data */
if (dn_after(ack, scp->ackrcv_oth)) { break;
scp->ackrcv_oth = ack & 0x0fff; case 2: /* ACK - OtherData */
wakeup |= dn_nsp_check_xmit_queue(sk, skb, &scp->other_xmit_queue, ack); if (dn_after(ack, scp->ackrcv_oth)) {
} scp->ackrcv_oth = ack & 0x0fff;
break; wakeup |= dn_nsp_check_xmit_queue(sk, skb,
case 3: /* NAK - OtherData */ &scp->other_xmit_queue,
break; ack);
}
break;
case 3: /* NAK - OtherData */
break;
} }
if (wakeup && !sock_flag(sk, SOCK_DEAD)) if (wakeup && !sock_flag(sk, SOCK_DEAD))
...@@ -417,19 +421,19 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb) ...@@ -417,19 +421,19 @@ 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;
sk->sk_err = ECONNREFUSED; sk->sk_err = ECONNREFUSED;
break; break;
case DN_RUN: case DN_RUN:
sk->sk_shutdown |= SHUTDOWN_MASK; sk->sk_shutdown |= SHUTDOWN_MASK;
scp->state = DN_DN; scp->state = DN_DN;
break; break;
case DN_DI: case DN_DI:
scp->state = DN_DIC; scp->state = DN_DIC;
break; break;
} }
if (!sock_flag(sk, SOCK_DEAD)) { if (!sock_flag(sk, SOCK_DEAD)) {
...@@ -470,23 +474,23 @@ static void dn_nsp_disc_conf(struct sock *sk, struct sk_buff *skb) ...@@ -470,23 +474,23 @@ 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;
case DN_DR: case DN_DR:
if (reason == NSP_REASON_DC) if (reason == NSP_REASON_DC)
scp->state = DN_DRC; scp->state = DN_DRC;
if (reason == NSP_REASON_NL) if (reason == NSP_REASON_NL)
scp->state = DN_CN;
break;
case DN_DI:
scp->state = DN_DIC;
break;
case DN_RUN:
sk->sk_shutdown |= SHUTDOWN_MASK;
case DN_CC:
scp->state = DN_CN; scp->state = DN_CN;
break;
case DN_DI:
scp->state = DN_DIC;
break;
case DN_RUN:
sk->sk_shutdown |= SHUTDOWN_MASK;
case DN_CC:
scp->state = DN_CN;
} }
if (!sock_flag(sk, SOCK_DEAD)) { if (!sock_flag(sk, SOCK_DEAD)) {
...@@ -692,16 +696,16 @@ static int dn_nsp_no_socket(struct sk_buff *skb, unsigned short reason) ...@@ -692,16 +696,16 @@ 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);
ret = NET_RX_SUCCESS; ret = NET_RX_SUCCESS;
break; break;
case 0x20: /* Connect Confirm */ case 0x20: /* Connect Confirm */
dn_nsp_return_disc(skb, NSP_DISCCONF, reason); dn_nsp_return_disc(skb, NSP_DISCCONF, reason);
ret = NET_RX_SUCCESS; ret = NET_RX_SUCCESS;
break; break;
} }
} }
...@@ -733,17 +737,17 @@ static int dn_nsp_rx_packet(struct sk_buff *skb) ...@@ -733,17 +737,17 @@ 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 */
goto free_out;
case 0x10:
case 0x60:
if (unlikely(cb->rt_flags & DN_RT_F_RTS))
goto free_out; goto free_out;
case 0x10: sk = dn_find_listener(skb, &reason);
case 0x60: goto got_it;
if (unlikely(cb->rt_flags & DN_RT_F_RTS))
goto free_out;
sk = dn_find_listener(skb, &reason);
goto got_it;
} }
} }
...@@ -836,20 +840,20 @@ int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb) ...@@ -836,20 +840,20 @@ 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);
break; break;
case 0x20: case 0x20:
dn_nsp_conn_conf(sk, skb); dn_nsp_conn_conf(sk, skb);
break; break;
case 0x30: case 0x30:
dn_nsp_disc_init(sk, skb); dn_nsp_disc_init(sk, skb);
break; break;
case 0x40: case 0x40:
dn_nsp_disc_conf(sk, skb); dn_nsp_disc_conf(sk, skb);
break; break;
} }
} else if (cb->nsp_flags == 0x24) { } else if (cb->nsp_flags == 0x24) {
...@@ -890,15 +894,15 @@ int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb) ...@@ -890,15 +894,15 @@ 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;
case 0x30: /* OD */ case 0x30: /* OD */
dn_nsp_otherdata(sk, skb); dn_nsp_otherdata(sk, skb);
break; break;
default: default:
dn_nsp_data(sk, skb); dn_nsp_data(sk, skb);
} }
} else { /* Ack, chuck it out here */ } else { /* Ack, chuck it out here */
......
...@@ -495,11 +495,11 @@ static int dn_route_rx_packet(struct sk_buff *skb) ...@@ -495,11 +495,11 @@ 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:
return dn_return_long(skb); return dn_return_long(skb);
} }
} }
...@@ -652,38 +652,38 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type ...@@ -652,38 +652,38 @@ 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;
case DN_RT_PKT_VERI: case DN_RT_PKT_VERI:
dn_dev_veri_pkt(skb); dn_dev_veri_pkt(skb);
break; break;
} }
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,
dn_route_ptp_hello); dn_route_ptp_hello);
case DN_RT_PKT_L1RT: case DN_RT_PKT_L1RT:
case DN_RT_PKT_L2RT: case DN_RT_PKT_L2RT:
return NF_HOOK(NFPROTO_DECNET, NF_DN_ROUTE, return NF_HOOK(NFPROTO_DECNET, NF_DN_ROUTE,
skb, skb->dev, NULL, skb, skb->dev, NULL,
dn_route_discard); dn_route_discard);
case DN_RT_PKT_ERTH: case DN_RT_PKT_ERTH:
return NF_HOOK(NFPROTO_DECNET, NF_DN_HELLO, return NF_HOOK(NFPROTO_DECNET, NF_DN_HELLO,
skb, skb->dev, NULL, skb, skb->dev, NULL,
dn_neigh_router_hello); dn_neigh_router_hello);
case DN_RT_PKT_EEDH: case DN_RT_PKT_EEDH:
return NF_HOOK(NFPROTO_DECNET, NF_DN_HELLO, return NF_HOOK(NFPROTO_DECNET, NF_DN_HELLO,
skb, skb->dev, NULL, skb, skb->dev, NULL,
dn_neigh_endnode_hello); dn_neigh_endnode_hello);
} }
} else { } else {
if (dn->parms.state != DN_DEV_S_RU) if (dn->parms.state != DN_DEV_S_RU)
...@@ -691,11 +691,11 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type ...@@ -691,11 +691,11 @@ 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:
return dn_route_rx_short(skb); return dn_route_rx_short(skb);
} }
} }
...@@ -1419,20 +1419,20 @@ static int dn_route_input_slow(struct sk_buff *skb) ...@@ -1419,20 +1419,20 @@ static int dn_route_input_slow(struct sk_buff *skb)
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;
case RTN_LOCAL: case RTN_LOCAL:
rt->dst.output = dn_output; rt->dst.output = dn_output;
rt->dst.input = dn_nsp_rx; rt->dst.input = dn_nsp_rx;
rt->dst.dev = in_dev; rt->dst.dev = in_dev;
flags |= RTCF_LOCAL; flags |= RTCF_LOCAL;
break; break;
default: default:
case RTN_UNREACHABLE: case RTN_UNREACHABLE:
case RTN_BLACKHOLE: case RTN_BLACKHOLE:
rt->dst.input = dst_discard; rt->dst.input = dst_discard;
} }
rt->rt_flags = flags; rt->rt_flags = flags;
......
...@@ -147,17 +147,18 @@ static void dn_rehash_zone(struct dn_zone *dz) ...@@ -147,17 +147,18 @@ 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",
case 256: old_divisor);
new_divisor = 1024; case 256:
new_hashmask = 0x3FF; new_divisor = 1024;
break; new_hashmask = 0x3FF;
break;
} }
ht = kcalloc(new_divisor, sizeof(struct dn_fib_node*), GFP_KERNEL); ht = kcalloc(new_divisor, sizeof(struct dn_fib_node*), GFP_KERNEL);
......
...@@ -69,15 +69,15 @@ static void dnrmg_send_peer(struct sk_buff *skb) ...@@ -69,15 +69,15 @@ 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;
case DN_RT_PKT_L2RT: case DN_RT_PKT_L2RT:
group = DNRNG_NLGRP_L2; group = DNRNG_NLGRP_L2;
break; break;
default: default:
return; return;
} }
skb2 = dnrmg_build_message(skb, &status); skb2 = dnrmg_build_message(skb, &status);
......
...@@ -68,14 +68,15 @@ static struct ctl_table_header *dn_table_header = NULL; ...@@ -68,14 +68,15 @@ 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;
case 0: /* Fallthrough */
return; case 0:
return;
} }
str++; str++;
} }
......
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