summaryrefslogtreecommitdiffstats
path: root/net/ax25
diff options
context:
space:
mode:
Diffstat (limited to 'net/ax25')
-rw-r--r--net/ax25/af_ax25.c9
-rw-r--r--net/ax25/ax25_ds_timer.c2
-rw-r--r--net/ax25/ax25_route.c2
-rw-r--r--net/ax25/ax25_std_timer.c4
-rw-r--r--net/ax25/ax25_uid.c6
-rw-r--r--net/ax25/sysctl_net_ax25.c27
6 files changed, 19 insertions, 31 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index b4725ff317c..1bc0e85f04a 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -330,10 +330,9 @@ void ax25_destroy_socket(ax25_cb *ax25)
if (atomic_read(&ax25->sk->sk_wmem_alloc) ||
atomic_read(&ax25->sk->sk_rmem_alloc)) {
/* Defer: outstanding buffers */
- init_timer(&ax25->dtimer);
+ setup_timer(&ax25->dtimer, ax25_destroy_timer,
+ (unsigned long)ax25);
ax25->dtimer.expires = jiffies + 2 * HZ;
- ax25->dtimer.function = ax25_destroy_timer;
- ax25->dtimer.data = (unsigned long)ax25;
add_timer(&ax25->dtimer);
} else {
struct sock *sk=ax25->sk;
@@ -571,7 +570,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
res = -EINVAL;
break;
}
- ax25->rtt = (opt * HZ) / 2;
+ ax25->rtt = (opt * HZ) >> 1;
ax25->t1 = opt * HZ;
break;
@@ -1864,6 +1863,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
#ifdef CONFIG_PROC_FS
static void *ax25_info_start(struct seq_file *seq, loff_t *pos)
+ __acquires(ax25_list_lock)
{
struct ax25_cb *ax25;
struct hlist_node *node;
@@ -1887,6 +1887,7 @@ static void *ax25_info_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void ax25_info_stop(struct seq_file *seq, void *v)
+ __releases(ax25_list_lock)
{
spin_unlock_bh(&ax25_list_lock);
}
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index 4f44185955c..c4e3b025d21 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -130,7 +130,7 @@ void ax25_ds_heartbeat_expiry(ax25_cb *ax25)
*/
if (sk != NULL) {
if (atomic_read(&sk->sk_rmem_alloc) <
- (sk->sk_rcvbuf / 2) &&
+ (sk->sk_rcvbuf >> 1) &&
(ax25->condition & AX25_COND_OWN_RX_BUSY)) {
ax25->condition &= ~AX25_COND_OWN_RX_BUSY;
ax25->condition &= ~AX25_COND_ACK_PENDING;
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index 9ecf6f1df86..38c7f3087ec 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -249,6 +249,7 @@ int ax25_rt_ioctl(unsigned int cmd, void __user *arg)
#ifdef CONFIG_PROC_FS
static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos)
+ __acquires(ax25_route_lock)
{
struct ax25_route *ax25_rt;
int i = 1;
@@ -274,6 +275,7 @@ static void *ax25_rt_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void ax25_rt_seq_stop(struct seq_file *seq, void *v)
+ __releases(ax25_route_lock)
{
read_unlock(&ax25_route_lock);
}
diff --git a/net/ax25/ax25_std_timer.c b/net/ax25/ax25_std_timer.c
index f2f6918ac9b..96e4b927325 100644
--- a/net/ax25/ax25_std_timer.c
+++ b/net/ax25/ax25_std_timer.c
@@ -32,7 +32,7 @@
void ax25_std_heartbeat_expiry(ax25_cb *ax25)
{
- struct sock *sk=ax25->sk;
+ struct sock *sk = ax25->sk;
if (sk)
bh_lock_sock(sk);
@@ -62,7 +62,7 @@ void ax25_std_heartbeat_expiry(ax25_cb *ax25)
*/
if (sk != NULL) {
if (atomic_read(&sk->sk_rmem_alloc) <
- (sk->sk_rcvbuf / 2) &&
+ (sk->sk_rcvbuf >> 1) &&
(ax25->condition & AX25_COND_OWN_RX_BUSY)) {
ax25->condition &= ~AX25_COND_OWN_RX_BUSY;
ax25->condition &= ~AX25_COND_ACK_PENDING;
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c
index ce0b13d4438..5f4eb73fb9d 100644
--- a/net/ax25/ax25_uid.c
+++ b/net/ax25/ax25_uid.c
@@ -43,10 +43,10 @@
* Callsign/UID mapper. This is in kernel space for security on multi-amateur machines.
*/
-HLIST_HEAD(ax25_uid_list);
+static HLIST_HEAD(ax25_uid_list);
static DEFINE_RWLOCK(ax25_uid_lock);
-int ax25_uid_policy = 0;
+int ax25_uid_policy;
EXPORT_SYMBOL(ax25_uid_policy);
@@ -144,6 +144,7 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax)
#ifdef CONFIG_PROC_FS
static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
+ __acquires(ax25_uid_lock)
{
struct ax25_uid_assoc *pt;
struct hlist_node *node;
@@ -167,6 +168,7 @@ static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void ax25_uid_seq_stop(struct seq_file *seq, void *v)
+ __releases(ax25_uid_lock)
{
read_unlock(&ax25_uid_lock);
}
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 443a8367663..f597987b242 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -31,25 +31,11 @@ static struct ctl_table_header *ax25_table_header;
static ctl_table *ax25_table;
static int ax25_table_size;
-static ctl_table ax25_dir_table[] = {
- {
- .ctl_name = NET_AX25,
- .procname = "ax25",
- .mode = 0555,
- },
- { .ctl_name = 0 }
-};
-
-static ctl_table ax25_root_table[] = {
- {
- .ctl_name = CTL_NET,
- .procname = "net",
- .mode = 0555,
- .child = ax25_dir_table
- },
- { .ctl_name = 0 }
+static struct ctl_path ax25_path[] = {
+ { .procname = "net", .ctl_name = CTL_NET, },
+ { .procname = "ax25", .ctl_name = NET_AX25, },
+ { }
};
-
static const ctl_table ax25_param_table[] = {
{
.ctl_name = NET_AX25_IP_DEFAULT_MODE,
@@ -243,9 +229,7 @@ void ax25_register_sysctl(void)
}
spin_unlock_bh(&ax25_dev_lock);
- ax25_dir_table[0].child = ax25_table;
-
- ax25_table_header = register_sysctl_table(ax25_root_table);
+ ax25_table_header = register_sysctl_paths(ax25_path, ax25_table);
}
void ax25_unregister_sysctl(void)
@@ -253,7 +237,6 @@ void ax25_unregister_sysctl(void)
ctl_table *p;
unregister_sysctl_table(ax25_table_header);
- ax25_dir_table[0].child = NULL;
for (p = ax25_table; p->ctl_name; p++)
kfree(p->child);
kfree(ax25_table);