aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose/rose_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rose/rose_route.c')
-rw-r--r--net/rose/rose_route.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 7252344779a0..8028c0d425dc 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -46,13 +46,13 @@ static DEFINE_SPINLOCK(rose_neigh_list_lock);
46static struct rose_route *rose_route_list; 46static struct rose_route *rose_route_list;
47static DEFINE_SPINLOCK(rose_route_list_lock); 47static DEFINE_SPINLOCK(rose_route_list_lock);
48 48
49struct rose_neigh *rose_loopback_neigh; 49struct rose_neigh rose_loopback_neigh;
50 50
51/* 51/*
52 * Add a new route to a node, and in the process add the node and the 52 * Add a new route to a node, and in the process add the node and the
53 * neighbour if it is new. 53 * neighbour if it is new.
54 */ 54 */
55static int rose_add_node(struct rose_route_struct *rose_route, 55static int __must_check rose_add_node(struct rose_route_struct *rose_route,
56 struct net_device *dev) 56 struct net_device *dev)
57{ 57{
58 struct rose_node *rose_node, *rose_tmpn, *rose_tmpp; 58 struct rose_node *rose_node, *rose_tmpn, *rose_tmpp;
@@ -361,33 +361,30 @@ out:
361/* 361/*
362 * Add the loopback neighbour. 362 * Add the loopback neighbour.
363 */ 363 */
364int rose_add_loopback_neigh(void) 364void rose_add_loopback_neigh(void)
365{ 365{
366 if ((rose_loopback_neigh = kmalloc(sizeof(struct rose_neigh), GFP_ATOMIC)) == NULL) 366 struct rose_neigh *sn = &rose_loopback_neigh;
367 return -ENOMEM;
368 367
369 rose_loopback_neigh->callsign = null_ax25_address; 368 sn->callsign = null_ax25_address;
370 rose_loopback_neigh->digipeat = NULL; 369 sn->digipeat = NULL;
371 rose_loopback_neigh->ax25 = NULL; 370 sn->ax25 = NULL;
372 rose_loopback_neigh->dev = NULL; 371 sn->dev = NULL;
373 rose_loopback_neigh->count = 0; 372 sn->count = 0;
374 rose_loopback_neigh->use = 0; 373 sn->use = 0;
375 rose_loopback_neigh->dce_mode = 1; 374 sn->dce_mode = 1;
376 rose_loopback_neigh->loopback = 1; 375 sn->loopback = 1;
377 rose_loopback_neigh->number = rose_neigh_no++; 376 sn->number = rose_neigh_no++;
378 rose_loopback_neigh->restarted = 1; 377 sn->restarted = 1;
379 378
380 skb_queue_head_init(&rose_loopback_neigh->queue); 379 skb_queue_head_init(&sn->queue);
381 380
382 init_timer(&rose_loopback_neigh->ftimer); 381 init_timer(&sn->ftimer);
383 init_timer(&rose_loopback_neigh->t0timer); 382 init_timer(&sn->t0timer);
384 383
385 spin_lock_bh(&rose_neigh_list_lock); 384 spin_lock_bh(&rose_neigh_list_lock);
386 rose_loopback_neigh->next = rose_neigh_list; 385 sn->next = rose_neigh_list;
387 rose_neigh_list = rose_loopback_neigh; 386 rose_neigh_list = sn;
388 spin_unlock_bh(&rose_neigh_list_lock); 387 spin_unlock_bh(&rose_neigh_list_lock);
389
390 return 0;
391} 388}
392 389
393/* 390/*
@@ -421,13 +418,13 @@ int rose_add_loopback_node(rose_address *address)
421 rose_node->mask = 10; 418 rose_node->mask = 10;
422 rose_node->count = 1; 419 rose_node->count = 1;
423 rose_node->loopback = 1; 420 rose_node->loopback = 1;
424 rose_node->neighbour[0] = rose_loopback_neigh; 421 rose_node->neighbour[0] = &rose_loopback_neigh;
425 422
426 /* Insert at the head of list. Address is always mask=10 */ 423 /* Insert at the head of list. Address is always mask=10 */
427 rose_node->next = rose_node_list; 424 rose_node->next = rose_node_list;
428 rose_node_list = rose_node; 425 rose_node_list = rose_node;
429 426
430 rose_loopback_neigh->count++; 427 rose_loopback_neigh.count++;
431 428
432out: 429out:
433 spin_unlock_bh(&rose_node_list_lock); 430 spin_unlock_bh(&rose_node_list_lock);
@@ -458,7 +455,7 @@ void rose_del_loopback_node(rose_address *address)
458 455
459 rose_remove_node(rose_node); 456 rose_remove_node(rose_node);
460 457
461 rose_loopback_neigh->count--; 458 rose_loopback_neigh.count--;
462 459
463out: 460out:
464 spin_unlock_bh(&rose_node_list_lock); 461 spin_unlock_bh(&rose_node_list_lock);