diff options
Diffstat (limited to 'net/x25')
-rw-r--r-- | net/x25/af_x25.c | 4 | ||||
-rw-r--r-- | net/x25/sysctl_net_x25.c | 24 | ||||
-rw-r--r-- | net/x25/x25_facilities.c | 4 | ||||
-rw-r--r-- | net/x25/x25_forward.c | 2 | ||||
-rw-r--r-- | net/x25/x25_in.c | 2 | ||||
-rw-r--r-- | net/x25/x25_link.c | 7 | ||||
-rw-r--r-- | net/x25/x25_proc.c | 8 | ||||
-rw-r--r-- | net/x25/x25_route.c | 2 | ||||
-rw-r--r-- | net/x25/x25_subr.c | 2 | ||||
-rw-r--r-- | net/x25/x25_timer.c | 4 |
10 files changed, 22 insertions, 37 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 92cfe8e..07fad7c 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -83,9 +83,9 @@ struct compat_x25_subscrip_struct { int x25_addr_ntoa(unsigned char *p, struct x25_address *called_addr, struct x25_address *calling_addr) { - int called_len, calling_len; + unsigned int called_len, calling_len; char *called, *calling; - int i; + unsigned int i; called_len = (*p >> 0) & 0x0F; calling_len = (*p >> 4) & 0x0F; diff --git a/net/x25/sysctl_net_x25.c b/net/x25/sysctl_net_x25.c index a59b77f..6ebda25 100644 --- a/net/x25/sysctl_net_x25.c +++ b/net/x25/sysctl_net_x25.c @@ -84,29 +84,15 @@ static struct ctl_table x25_table[] = { { 0, }, }; -static struct ctl_table x25_dir_table[] = { - { - .ctl_name = NET_X25, - .procname = "x25", - .mode = 0555, - .child = x25_table, - }, - { 0, }, -}; - -static struct ctl_table x25_root_table[] = { - { - .ctl_name = CTL_NET, - .procname = "net", - .mode = 0555, - .child = x25_dir_table, - }, - { 0, }, +static struct ctl_path x25_path[] = { + { .procname = "net", .ctl_name = CTL_NET, }, + { .procname = "x25", .ctl_name = NET_X25, }, + { } }; void __init x25_register_sysctl(void) { - x25_table_header = register_sysctl_table(x25_root_table); + x25_table_header = register_sysctl_paths(x25_path, x25_table); } void x25_unregister_sysctl(void) diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c index dec404a..a21f664 100644 --- a/net/x25/x25_facilities.c +++ b/net/x25/x25_facilities.c @@ -205,9 +205,7 @@ int x25_create_facilities(unsigned char *buffer, } if (dte_facs->calling_len && (facil_mask & X25_MASK_CALLING_AE)) { - unsigned bytecount = (dte_facs->calling_len % 2) ? - dte_facs->calling_len / 2 + 1 : - dte_facs->calling_len / 2; + unsigned bytecount = (dte_facs->calling_len + 1) >> 1; *p++ = X25_FAC_CALLING_AE; *p++ = 1 + bytecount; *p++ = dte_facs->calling_len; diff --git a/net/x25/x25_forward.c b/net/x25/x25_forward.c index 3447803..056a55f 100644 --- a/net/x25/x25_forward.c +++ b/net/x25/x25_forward.c @@ -12,7 +12,7 @@ #include <linux/init.h> #include <net/x25.h> -struct list_head x25_forward_list = LIST_HEAD_INIT(x25_forward_list); +LIST_HEAD(x25_forward_list); DEFINE_RWLOCK(x25_forward_list_lock); int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from, diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index 1c88762..7d7c3ab 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c @@ -247,7 +247,7 @@ static int x25_state3_machine(struct sock *sk, struct sk_buff *skb, int frametyp break; } if (atomic_read(&sk->sk_rmem_alloc) > - (sk->sk_rcvbuf / 2)) + (sk->sk_rcvbuf >> 1)) x25->condition |= X25_COND_OWN_RX_BUSY; } /* diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c index 741ce95..e4e1b6e 100644 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c @@ -30,7 +30,7 @@ #include <linux/init.h> #include <net/x25.h> -static struct list_head x25_neigh_list = LIST_HEAD_INIT(x25_neigh_list); +static LIST_HEAD(x25_neigh_list); static DEFINE_RWLOCK(x25_neigh_list_lock); static void x25_t20timer_expiry(unsigned long); @@ -247,10 +247,7 @@ void x25_link_device_up(struct net_device *dev) return; skb_queue_head_init(&nb->queue); - - init_timer(&nb->t20timer); - nb->t20timer.data = (unsigned long)nb; - nb->t20timer.function = &x25_t20timer_expiry; + setup_timer(&nb->t20timer, x25_t20timer_expiry, (unsigned long)nb); dev_hold(dev); nb->dev = dev; diff --git a/net/x25/x25_proc.c b/net/x25/x25_proc.c index 7d55e50..3f52b09 100644 --- a/net/x25/x25_proc.c +++ b/net/x25/x25_proc.c @@ -41,6 +41,7 @@ found: } static void *x25_seq_route_start(struct seq_file *seq, loff_t *pos) + __acquires(x25_route_list_lock) { loff_t l = *pos; @@ -70,6 +71,7 @@ out: } static void x25_seq_route_stop(struct seq_file *seq, void *v) + __releases(x25_route_list_lock) { read_unlock_bh(&x25_route_list_lock); } @@ -105,6 +107,7 @@ found: } static void *x25_seq_socket_start(struct seq_file *seq, loff_t *pos) + __acquires(x25_list_lock) { loff_t l = *pos; @@ -127,6 +130,7 @@ out: } static void x25_seq_socket_stop(struct seq_file *seq, void *v) + __releases(x25_list_lock) { read_unlock_bh(&x25_list_lock); } @@ -183,6 +187,7 @@ found: } static void *x25_seq_forward_start(struct seq_file *seq, loff_t *pos) + __acquires(x25_forward_list_lock) { loff_t l = *pos; @@ -213,6 +218,7 @@ out: } static void x25_seq_forward_stop(struct seq_file *seq, void *v) + __releases(x25_forward_list_lock) { read_unlock_bh(&x25_forward_list_lock); } @@ -287,7 +293,7 @@ static const struct file_operations x25_seq_route_fops = { .release = seq_release, }; -static struct file_operations x25_seq_forward_fops = { +static const struct file_operations x25_seq_forward_fops = { .owner = THIS_MODULE, .open = x25_seq_forward_open, .read = seq_read, diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c index 86b5b4d..2c999cc 100644 --- a/net/x25/x25_route.c +++ b/net/x25/x25_route.c @@ -21,7 +21,7 @@ #include <linux/init.h> #include <net/x25.h> -struct list_head x25_route_list = LIST_HEAD_INIT(x25_route_list); +LIST_HEAD(x25_route_list); DEFINE_RWLOCK(x25_route_list_lock); /* diff --git a/net/x25/x25_subr.c b/net/x25/x25_subr.c index 8d6220a..511a598 100644 --- a/net/x25/x25_subr.c +++ b/net/x25/x25_subr.c @@ -359,7 +359,7 @@ void x25_check_rbuf(struct sock *sk) { struct x25_sock *x25 = x25_sk(sk); - if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf / 2) && + if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf >> 1) && (x25->condition & X25_COND_OWN_RX_BUSY)) { x25->condition &= ~X25_COND_OWN_RX_BUSY; x25->condition &= ~X25_COND_ACK_PENDING; diff --git a/net/x25/x25_timer.c b/net/x25/x25_timer.c index 2af190d..d3e3e54 100644 --- a/net/x25/x25_timer.c +++ b/net/x25/x25_timer.c @@ -33,9 +33,7 @@ void x25_init_timers(struct sock *sk) { struct x25_sock *x25 = x25_sk(sk); - init_timer(&x25->timer); - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; + setup_timer(&x25->timer, x25_timer_expiry, (unsigned long)sk); /* initialized by sock_init_data */ sk->sk_timer.data = (unsigned long)sk; |