[NET] AX25: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f7d57453d2
commit
528930b91e
|
@ -369,57 +369,57 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
|
|||
ax25_disconnect(ax25, ENETRESET);
|
||||
break;
|
||||
|
||||
case AX25_WINDOW:
|
||||
if (ax25->modulus == AX25_MODULUS) {
|
||||
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 7)
|
||||
return -EINVAL;
|
||||
} else {
|
||||
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 63)
|
||||
return -EINVAL;
|
||||
}
|
||||
ax25->window = ax25_ctl.arg;
|
||||
break;
|
||||
case AX25_WINDOW:
|
||||
if (ax25->modulus == AX25_MODULUS) {
|
||||
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 7)
|
||||
return -EINVAL;
|
||||
} else {
|
||||
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 63)
|
||||
return -EINVAL;
|
||||
}
|
||||
ax25->window = ax25_ctl.arg;
|
||||
break;
|
||||
|
||||
case AX25_T1:
|
||||
case AX25_T1:
|
||||
if (ax25_ctl.arg < 1)
|
||||
return -EINVAL;
|
||||
ax25->rtt = (ax25_ctl.arg * HZ) / 2;
|
||||
ax25->t1 = ax25_ctl.arg * HZ;
|
||||
break;
|
||||
|
||||
case AX25_T2:
|
||||
if (ax25_ctl.arg < 1)
|
||||
return -EINVAL;
|
||||
ax25->t2 = ax25_ctl.arg * HZ;
|
||||
break;
|
||||
|
||||
case AX25_N2:
|
||||
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 31)
|
||||
return -EINVAL;
|
||||
ax25->n2count = 0;
|
||||
ax25->n2 = ax25_ctl.arg;
|
||||
break;
|
||||
ax25->rtt = (ax25_ctl.arg * HZ) / 2;
|
||||
ax25->t1 = ax25_ctl.arg * HZ;
|
||||
break;
|
||||
|
||||
case AX25_T3:
|
||||
if (ax25_ctl.arg < 0)
|
||||
return -EINVAL;
|
||||
ax25->t3 = ax25_ctl.arg * HZ;
|
||||
break;
|
||||
case AX25_T2:
|
||||
if (ax25_ctl.arg < 1)
|
||||
return -EINVAL;
|
||||
ax25->t2 = ax25_ctl.arg * HZ;
|
||||
break;
|
||||
|
||||
case AX25_IDLE:
|
||||
if (ax25_ctl.arg < 0)
|
||||
return -EINVAL;
|
||||
ax25->idle = ax25_ctl.arg * 60 * HZ;
|
||||
break;
|
||||
case AX25_N2:
|
||||
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 31)
|
||||
return -EINVAL;
|
||||
ax25->n2count = 0;
|
||||
ax25->n2 = ax25_ctl.arg;
|
||||
break;
|
||||
|
||||
case AX25_PACLEN:
|
||||
if (ax25_ctl.arg < 16 || ax25_ctl.arg > 65535)
|
||||
return -EINVAL;
|
||||
ax25->paclen = ax25_ctl.arg;
|
||||
break;
|
||||
case AX25_T3:
|
||||
if (ax25_ctl.arg < 0)
|
||||
return -EINVAL;
|
||||
ax25->t3 = ax25_ctl.arg * HZ;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
case AX25_IDLE:
|
||||
if (ax25_ctl.arg < 0)
|
||||
return -EINVAL;
|
||||
ax25->idle = ax25_ctl.arg * 60 * HZ;
|
||||
break;
|
||||
|
||||
case AX25_PACLEN:
|
||||
if (ax25_ctl.arg < 16 || ax25_ctl.arg > 65535)
|
||||
return -EINVAL;
|
||||
ax25->paclen = ax25_ctl.arg;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1209,7 +1209,7 @@ static int __must_check ax25_connect(struct socket *sock,
|
|||
|
||||
if (sk->sk_type == SOCK_SEQPACKET &&
|
||||
(ax25t=ax25_find_cb(&ax25->source_addr, &fsa->fsa_ax25.sax25_call, digi,
|
||||
ax25->ax25_dev->dev))) {
|
||||
ax25->ax25_dev->dev))) {
|
||||
kfree(digi);
|
||||
err = -EADDRINUSE; /* Already such a connection */
|
||||
ax25_cb_put(ax25t);
|
||||
|
@ -1470,8 +1470,8 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
|
|||
else if (addr_len != sizeof(struct full_sockaddr_ax25)) {
|
||||
/* support for old structure may go away some time */
|
||||
if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
|
||||
(addr_len > sizeof(struct full_sockaddr_ax25))) {
|
||||
err = -EINVAL;
|
||||
(addr_len > sizeof(struct full_sockaddr_ax25))) {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -1624,7 +1624,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||
|
||||
/* Now we can treat all alike */
|
||||
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
|
||||
flags & MSG_DONTWAIT, &err);
|
||||
flags & MSG_DONTWAIT, &err);
|
||||
if (skb == NULL)
|
||||
goto out;
|
||||
|
||||
|
|
|
@ -126,10 +126,10 @@ int ax25cmp(const ax25_address *a, const ax25_address *b)
|
|||
ct++;
|
||||
}
|
||||
|
||||
if ((a->ax25_call[ct] & 0x1E) == (b->ax25_call[ct] & 0x1E)) /* SSID without control bit */
|
||||
return 0;
|
||||
if ((a->ax25_call[ct] & 0x1E) == (b->ax25_call[ct] & 0x1E)) /* SSID without control bit */
|
||||
return 0;
|
||||
|
||||
return 2; /* Partial match */
|
||||
return 2; /* Partial match */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(ax25cmp);
|
||||
|
|
|
@ -55,46 +55,46 @@ int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short
|
|||
if (type == ETH_P_AX25)
|
||||
return 0;
|
||||
|
||||
/* header is an AX.25 UI frame from us to them */
|
||||
buff = skb_push(skb, AX25_HEADER_LEN);
|
||||
*buff++ = 0x00; /* KISS DATA */
|
||||
/* header is an AX.25 UI frame from us to them */
|
||||
buff = skb_push(skb, AX25_HEADER_LEN);
|
||||
*buff++ = 0x00; /* KISS DATA */
|
||||
|
||||
if (daddr != NULL)
|
||||
memcpy(buff, daddr, dev->addr_len); /* Address specified */
|
||||
|
||||
buff[6] &= ~AX25_CBIT;
|
||||
buff[6] &= ~AX25_EBIT;
|
||||
buff[6] |= AX25_SSSID_SPARE;
|
||||
buff += AX25_ADDR_LEN;
|
||||
buff[6] &= ~AX25_CBIT;
|
||||
buff[6] &= ~AX25_EBIT;
|
||||
buff[6] |= AX25_SSSID_SPARE;
|
||||
buff += AX25_ADDR_LEN;
|
||||
|
||||
if (saddr != NULL)
|
||||
memcpy(buff, saddr, dev->addr_len);
|
||||
else
|
||||
memcpy(buff, dev->dev_addr, dev->addr_len);
|
||||
if (saddr != NULL)
|
||||
memcpy(buff, saddr, dev->addr_len);
|
||||
else
|
||||
memcpy(buff, dev->dev_addr, dev->addr_len);
|
||||
|
||||
buff[6] &= ~AX25_CBIT;
|
||||
buff[6] |= AX25_EBIT;
|
||||
buff[6] |= AX25_SSSID_SPARE;
|
||||
buff += AX25_ADDR_LEN;
|
||||
buff[6] &= ~AX25_CBIT;
|
||||
buff[6] |= AX25_EBIT;
|
||||
buff[6] |= AX25_SSSID_SPARE;
|
||||
buff += AX25_ADDR_LEN;
|
||||
|
||||
*buff++ = AX25_UI; /* UI */
|
||||
*buff++ = AX25_UI; /* UI */
|
||||
|
||||
/* Append a suitable AX.25 PID */
|
||||
switch (type) {
|
||||
case ETH_P_IP:
|
||||
*buff++ = AX25_P_IP;
|
||||
break;
|
||||
case ETH_P_ARP:
|
||||
*buff++ = AX25_P_ARP;
|
||||
break;
|
||||
default:
|
||||
printk(KERN_ERR "AX.25: ax25_hard_header - wrong protocol type 0x%2.2x\n", type);
|
||||
*buff++ = 0;
|
||||
break;
|
||||
}
|
||||
/* Append a suitable AX.25 PID */
|
||||
switch (type) {
|
||||
case ETH_P_IP:
|
||||
*buff++ = AX25_P_IP;
|
||||
break;
|
||||
case ETH_P_ARP:
|
||||
*buff++ = AX25_P_ARP;
|
||||
break;
|
||||
default:
|
||||
printk(KERN_ERR "AX.25: ax25_hard_header - wrong protocol type 0x%2.2x\n", type);
|
||||
*buff++ = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (daddr != NULL)
|
||||
return AX25_HEADER_LEN;
|
||||
return AX25_HEADER_LEN;
|
||||
|
||||
return -AX25_HEADER_LEN; /* Unfinished header */
|
||||
}
|
||||
|
@ -114,8 +114,8 @@ int ax25_rebuild_header(struct sk_buff *skb)
|
|||
dst = (ax25_address *)(bp + 1);
|
||||
src = (ax25_address *)(bp + 8);
|
||||
|
||||
if (arp_find(bp + 1, skb))
|
||||
return 1;
|
||||
if (arp_find(bp + 1, skb))
|
||||
return 1;
|
||||
|
||||
route = ax25_get_route(dst, NULL);
|
||||
if (route) {
|
||||
|
@ -127,8 +127,8 @@ int ax25_rebuild_header(struct sk_buff *skb)
|
|||
if (dev == NULL)
|
||||
dev = skb->dev;
|
||||
|
||||
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
|
||||
goto put;
|
||||
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
|
||||
goto put;
|
||||
}
|
||||
|
||||
if (bp[16] == AX25_P_IP) {
|
||||
|
@ -186,13 +186,13 @@ int ax25_rebuild_header(struct sk_buff *skb)
|
|||
}
|
||||
}
|
||||
|
||||
bp[7] &= ~AX25_CBIT;
|
||||
bp[7] &= ~AX25_EBIT;
|
||||
bp[7] |= AX25_SSSID_SPARE;
|
||||
bp[7] &= ~AX25_CBIT;
|
||||
bp[7] &= ~AX25_EBIT;
|
||||
bp[7] |= AX25_SSSID_SPARE;
|
||||
|
||||
bp[14] &= ~AX25_CBIT;
|
||||
bp[14] |= AX25_EBIT;
|
||||
bp[14] |= AX25_SSSID_SPARE;
|
||||
bp[14] &= ~AX25_CBIT;
|
||||
bp[14] |= AX25_EBIT;
|
||||
bp[14] |= AX25_SSSID_SPARE;
|
||||
|
||||
skb_pull(skb, AX25_KISS_HEADER_LEN);
|
||||
|
||||
|
@ -211,7 +211,7 @@ put:
|
|||
if (route)
|
||||
ax25_put_route(route);
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else /* INET */
|
||||
|
|
|
@ -87,7 +87,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
|
|||
ax25_rt = ax25_route_list;
|
||||
while (ax25_rt != NULL) {
|
||||
if (ax25cmp(&ax25_rt->callsign, &route->dest_addr) == 0 &&
|
||||
ax25_rt->dev == ax25_dev->dev) {
|
||||
ax25_rt->dev == ax25_dev->dev) {
|
||||
kfree(ax25_rt->digipeat);
|
||||
ax25_rt->digipeat = NULL;
|
||||
if (route->digi_count != 0) {
|
||||
|
@ -253,7 +253,7 @@ static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos)
|
|||
struct ax25_route *ax25_rt;
|
||||
int i = 1;
|
||||
|
||||
read_lock(&ax25_route_lock);
|
||||
read_lock(&ax25_route_lock);
|
||||
if (*pos == 0)
|
||||
return SEQ_START_TOKEN;
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr)
|
|||
*/
|
||||
if (ax25->va != nr) {
|
||||
while (skb_peek(&ax25->ack_queue) != NULL && ax25->va != nr) {
|
||||
skb = skb_dequeue(&ax25->ack_queue);
|
||||
skb = skb_dequeue(&ax25->ack_queue);
|
||||
kfree_skb(skb);
|
||||
ax25->va = (ax25->va + 1) % ax25->modulus;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr)
|
|||
|
||||
void ax25_requeue_frames(ax25_cb *ax25)
|
||||
{
|
||||
struct sk_buff *skb, *skb_prev = NULL;
|
||||
struct sk_buff *skb, *skb_prev = NULL;
|
||||
|
||||
/*
|
||||
* Requeue all the un-ack-ed frames on the output queue to be picked
|
||||
|
|
|
@ -164,7 +164,7 @@ static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos)
|
|||
++*pos;
|
||||
|
||||
return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next,
|
||||
ax25_uid_assoc, uid_node);
|
||||
ax25_uid_assoc, uid_node);
|
||||
}
|
||||
|
||||
static void ax25_uid_seq_stop(struct seq_file *seq, void *v)
|
||||
|
|
Loading…
Reference in New Issue