diff options
author | Jon Maloy <jon.maloy@ericsson.com> | 2018-02-15 12:40:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-16 23:26:33 +0300 |
commit | c901d26d4a8137f3ad0e5865d331f7c63c42d9f9 (patch) | |
tree | 89ff5b5f5fd1cb4f4c5c002cd2ada9353154d70d /net/tipc/subscr.c | |
parent | 27469b7352b5197cffa0e3dadb5f1127f055da27 (diff) | |
download | linux-c901d26d4a8137f3ad0e5865d331f7c63c42d9f9.tar.xz |
tipc: remove unnecessary function pointers
Interaction between the functionality in server.c and subscr.c is
done via function pointers installed in struct server. This makes
the code harder to follow, and doesn't serve any obvious purpose.
Here, we replace the function pointers with direct function calls.
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/subscr.c')
-rw-r--r-- | net/tipc/subscr.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index eaef826fc06d..b86fbbf7a0b9 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c @@ -220,7 +220,7 @@ static void tipc_subscrb_subscrp_delete(struct tipc_subscriber *subscriber, spin_unlock_bh(&subscriber->lock); } -static struct tipc_subscriber *tipc_subscrb_create(int conid) +struct tipc_subscriber *tipc_subscrb_create(int conid) { struct tipc_subscriber *subscriber; @@ -237,7 +237,7 @@ static struct tipc_subscriber *tipc_subscrb_create(int conid) return subscriber; } -static void tipc_subscrb_delete(struct tipc_subscriber *subscriber) +void tipc_subscrb_delete(struct tipc_subscriber *subscriber) { tipc_subscrb_subscrp_delete(subscriber, NULL); tipc_subscrb_put(subscriber); @@ -315,16 +315,10 @@ static int tipc_subscrp_subscribe(struct net *net, struct tipc_subscr *s, return 0; } -/* Handle one termination request for the subscriber */ -static void tipc_subscrb_release_cb(int conid, void *usr_data) -{ - tipc_subscrb_delete((struct tipc_subscriber *)usr_data); -} - -/* Handle one request to create a new subscription for the subscriber */ -static int tipc_subscrb_rcv_cb(struct net *net, int conid, - struct sockaddr_tipc *addr, void *usr_data, - void *buf, size_t len) +/* Handle one request to create a new subscription for the subscriber + */ +int tipc_subscrb_rcv(struct net *net, int conid, void *usr_data, + void *buf, size_t len) { struct tipc_subscriber *subscriber = usr_data; struct tipc_subscr *s = (struct tipc_subscr *)buf; @@ -345,12 +339,6 @@ static int tipc_subscrb_rcv_cb(struct net *net, int conid, return tipc_subscrp_subscribe(net, s, subscriber, swap, status); } -/* Handle one request to establish a new subscriber */ -static void *tipc_subscrb_connect_cb(int conid) -{ - return (void *)tipc_subscrb_create(conid); -} - int tipc_topsrv_start(struct net *net) { struct tipc_net *tn = net_generic(net, tipc_net_id); @@ -376,9 +364,6 @@ int tipc_topsrv_start(struct net *net) topsrv->net = net; topsrv->saddr = saddr; topsrv->max_rcvbuf_size = sizeof(struct tipc_subscr); - topsrv->tipc_conn_recvmsg = tipc_subscrb_rcv_cb; - topsrv->tipc_conn_new = tipc_subscrb_connect_cb; - topsrv->tipc_conn_release = tipc_subscrb_release_cb; strncpy(topsrv->name, name, strlen(name) + 1); tn->topsrv = topsrv; |