Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / net / netrom / nr_route.c
index 0505c00..b3b9097 100644 (file)
 static unsigned int nr_neigh_no = 1;
 
 static HLIST_HEAD(nr_node_list);
-static spinlock_t nr_node_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(nr_node_list_lock);
 static HLIST_HEAD(nr_neigh_list);
-static spinlock_t nr_neigh_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(nr_neigh_list_lock);
 
-struct nr_node *nr_node_get(ax25_address *callsign)
+static struct nr_node *nr_node_get(ax25_address *callsign)
 {
        struct nr_node *found = NULL;
        struct nr_node *nr_node;
@@ -62,7 +62,8 @@ struct nr_node *nr_node_get(ax25_address *callsign)
        return found;
 }
 
-struct nr_neigh *nr_neigh_get_dev(ax25_address *callsign, struct net_device *dev)
+static struct nr_neigh *nr_neigh_get_dev(ax25_address *callsign,
+                                        struct net_device *dev)
 {
        struct nr_neigh *found = NULL;
        struct nr_neigh *nr_neigh;
@@ -186,7 +187,7 @@ static int nr_add_node(ax25_address *nr, const char *mnemonic, ax25_address *ax2
                nr_node->which = 0;
                nr_node->count = 1;
                atomic_set(&nr_node->refcount, 1);
-               nr_node->node_lock = SPIN_LOCK_UNLOCKED;
+               spin_lock_init(&nr_node->node_lock);
 
                nr_node->routes[0].quality   = quality;
                nr_node->routes[0].obs_count = obs_count;
@@ -647,7 +648,7 @@ static ax25_digi *nr_call_to_digi(int ndigis, ax25_address *digipeaters)
 /*
  *     Handle the ioctls that control the routing functions.
  */
-int nr_rt_ioctl(unsigned int cmd, void *arg)
+int nr_rt_ioctl(unsigned int cmd, void __user *arg)
 {
        struct nr_route_struct nr_route;
        struct net_device *dev;
@@ -880,6 +881,7 @@ static void nr_node_stop(struct seq_file *seq, void *v)
 
 static int nr_node_show(struct seq_file *seq, void *v)
 {
+       char buf[11];
        int i;
 
        if (v == SEQ_START_TOKEN)
@@ -889,7 +891,7 @@ static int nr_node_show(struct seq_file *seq, void *v)
                struct nr_node *nr_node = v;
                nr_node_lock(nr_node);
                seq_printf(seq, "%-9s %-7s  %d %d",
-                       ax2asc(&nr_node->callsign),
+                       ax2asc(buf, &nr_node->callsign),
                        (nr_node->mnemonic[0] == '\0') ? "*" : nr_node->mnemonic,
                        nr_node->which + 1,
                        nr_node->count);
@@ -963,6 +965,7 @@ static void nr_neigh_stop(struct seq_file *seq, void *v)
 
 static int nr_neigh_show(struct seq_file *seq, void *v)
 {
+       char buf[11];
        int i;
 
        if (v == SEQ_START_TOKEN)
@@ -972,7 +975,7 @@ static int nr_neigh_show(struct seq_file *seq, void *v)
 
                seq_printf(seq, "%05d %-9s %-4s  %3d    %d   %3d    %3d",
                        nr_neigh->number,
-                       ax2asc(&nr_neigh->callsign),
+                       ax2asc(buf, &nr_neigh->callsign),
                        nr_neigh->dev ? nr_neigh->dev->name : "???",
                        nr_neigh->quality,
                        nr_neigh->locked,
@@ -982,7 +985,7 @@ static int nr_neigh_show(struct seq_file *seq, void *v)
                if (nr_neigh->digipeat != NULL) {
                        for (i = 0; i < nr_neigh->digipeat->ndigi; i++)
                                seq_printf(seq, " %s", 
-                                          ax2asc(&nr_neigh->digipeat->calls[i]));
+                                          ax2asc(buf, &nr_neigh->digipeat->calls[i]));
                }
 
                seq_puts(seq, "\n");