tipc: cleanup various cosmetic whitespace issues
[deliverable/linux.git] / net / tipc / subscr.c
index 23f43d03980cfd36d4ebb95ddb7dd3b685269f13..acc30e1833c932491a34a8576bed8ddf265d2efd 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "core.h"
 #include "name_table.h"
-#include "user_reg.h"
+#include "port.h"
 #include "subscr.h"
 
 /**
@@ -64,7 +64,6 @@ struct subscriber {
  */
 
 struct top_srv {
-       u32 user_ref;
        u32 setup_port;
        atomic_t subscription_count;
        struct list_head subscriber_list;
@@ -250,8 +249,6 @@ static void subscr_terminate(struct subscriber *subscriber)
                        k_cancel_timer(&sub->timer);
                        k_term_timer(&sub->timer);
                }
-               dbg("Term: Removing sub %u,%u,%u from subscriber %x list\n",
-                   sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
                subscr_del(sub);
        }
 
@@ -308,8 +305,6 @@ static void subscr_cancel(struct tipc_subscr *s,
                k_term_timer(&sub->timer);
                spin_lock_bh(subscriber->lock);
        }
-       dbg("Cancel: removing sub %u,%u,%u from subscriber %x list\n",
-           sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
        subscr_del(sub);
 }
 
@@ -494,8 +489,7 @@ static void subscr_named_msg_event(void *usr_handle,
 
        /* Create server port & establish connection to subscriber */
 
-       tipc_createport(topsrv.user_ref,
-                       subscriber,
+       tipc_createport(subscriber,
                        importance,
                        NULL,
                        NULL,
@@ -544,19 +538,12 @@ int tipc_subscr_start(void)
        struct tipc_name_seq seq = {TIPC_TOP_SRV, TIPC_TOP_SRV, TIPC_TOP_SRV};
        int res;
 
-       memset(&topsrv, 0, sizeof (topsrv));
+       memset(&topsrv, 0, sizeof(topsrv));
        spin_lock_init(&topsrv.lock);
        INIT_LIST_HEAD(&topsrv.subscriber_list);
 
        spin_lock_bh(&topsrv.lock);
-       res = tipc_attach(&topsrv.user_ref);
-       if (res) {
-               spin_unlock_bh(&topsrv.lock);
-               return res;
-       }
-
-       res = tipc_createport(topsrv.user_ref,
-                             NULL,
+       res = tipc_createport(NULL,
                              TIPC_CRITICAL_IMPORTANCE,
                              NULL,
                              NULL,
@@ -570,16 +557,17 @@ int tipc_subscr_start(void)
                goto failed;
 
        res = tipc_nametbl_publish_rsv(topsrv.setup_port, TIPC_NODE_SCOPE, &seq);
-       if (res)
+       if (res) {
+               tipc_deleteport(topsrv.setup_port);
+               topsrv.setup_port = 0;
                goto failed;
+       }
 
        spin_unlock_bh(&topsrv.lock);
        return 0;
 
 failed:
        err("Failed to create subscription service\n");
-       tipc_detach(topsrv.user_ref);
-       topsrv.user_ref = 0;
        spin_unlock_bh(&topsrv.lock);
        return res;
 }
@@ -590,8 +578,10 @@ void tipc_subscr_stop(void)
        struct subscriber *subscriber_temp;
        spinlock_t *subscriber_lock;
 
-       if (topsrv.user_ref) {
+       if (topsrv.setup_port) {
                tipc_deleteport(topsrv.setup_port);
+               topsrv.setup_port = 0;
+
                list_for_each_entry_safe(subscriber, subscriber_temp,
                                         &topsrv.subscriber_list,
                                         subscriber_list) {
@@ -600,7 +590,5 @@ void tipc_subscr_stop(void)
                        subscr_terminate(subscriber);
                        spin_unlock_bh(subscriber_lock);
                }
-               tipc_detach(topsrv.user_ref);
-               topsrv.user_ref = 0;
        }
 }
This page took 0.025992 seconds and 5 git commands to generate.