From a4aa8ae4912194d57340d71afeb9181792b39299 Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Sun, 19 Jan 2020 17:44:27 +0800 Subject: [PATCH] wqueue/notifier: update the work notifier usage usage changed after commit 90c52e6f8f7efce97ac718c0f98addc13ec880d2 Change-Id: Ifb0d739b046a6794b5b3ac177f489fb9a1c5c799 Signed-off-by: chao.an --- mm/iob/iob_notifier.c | 2 +- net/netdev/netdown_notifier.c | 2 +- net/netlink/netlink_conn.c | 18 ++---------------- net/netlink/netlink_notifier.c | 2 +- net/netlink/netlink_sockif.c | 16 ++-------------- net/tcp/tcp_notifier.c | 6 +++--- net/udp/udp_notifier.c | 4 ++-- 7 files changed, 12 insertions(+), 38 deletions(-) diff --git a/mm/iob/iob_notifier.c b/mm/iob/iob_notifier.c index 0a7015cfff..041a6e0d03 100644 --- a/mm/iob/iob_notifier.c +++ b/mm/iob/iob_notifier.c @@ -143,7 +143,7 @@ void iob_notifier_signal(void) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_IOB_AVAIL, NULL); + work_notifier_signal(WORK_IOB_AVAIL, NULL); } #endif /* CONFIG_IOB_NOTIFIER */ diff --git a/net/netdev/netdown_notifier.c b/net/netdev/netdown_notifier.c index 371fbbe100..e726a53f17 100644 --- a/net/netdev/netdown_notifier.c +++ b/net/netdev/netdown_notifier.c @@ -151,7 +151,7 @@ void netdown_notifier_signal(FAR struct net_driver_s *dev) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_NET_DOWN, dev); + work_notifier_signal(WORK_NET_DOWN, dev); } #endif /* CONFIG_NETDOWN_NOTIFIER */ diff --git a/net/netlink/netlink_conn.c b/net/netlink/netlink_conn.c index 6fad4bca56..061f3cf6d6 100644 --- a/net/netlink/netlink_conn.c +++ b/net/netlink/netlink_conn.c @@ -114,25 +114,11 @@ static void _netlink_semgive(FAR sem_t *sem) static void netlink_response_available(FAR void *arg) { - /* The entire notifier entry is passed to us. That is because we are - * responsible for disposing of the entry via kmm_free() when we are - * finished with it. - */ - - FAR struct work_notifier_entry_s *notifier = - (FAR struct work_notifier_entry_s *)arg; - FAR sem_t *waitsem; - - DEBUGASSERT(notifier != NULL && notifier->info.qualifier != NULL); - waitsem = (FAR sem_t *)notifier->info.arg; - - /* Free the notifier entry */ - - kmm_free(notifier); + DEBUGASSERT(arg != NULL); /* wakeup the waiter */ - nxsem_post(waitsem); + _netlink_semgive(arg); } /**************************************************************************** diff --git a/net/netlink/netlink_notifier.c b/net/netlink/netlink_notifier.c index d00d773f42..c9f37db96a 100644 --- a/net/netlink/netlink_notifier.c +++ b/net/netlink/netlink_notifier.c @@ -144,5 +144,5 @@ void netlink_notifier_signal(FAR struct netlink_conn_s *conn) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_NETLINK_RESPONSE, conn); + work_notifier_signal(WORK_NETLINK_RESPONSE, conn); } diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c index 378cbaecdb..40d8d3d975 100644 --- a/net/netlink/netlink_sockif.c +++ b/net/netlink/netlink_sockif.c @@ -503,21 +503,9 @@ static int netlink_accept(FAR struct socket *psock, FAR struct sockaddr *addr, static void netlink_response_available(FAR void *arg) { - /* The entire notifier entry is passed to us. That is because we are - * responsible for disposing of the entry via kmm_free() when we are - * finished with it. - */ + FAR struct netlink_conn_s *conn = arg; - FAR struct work_notifier_entry_s *notifier = - (FAR struct work_notifier_entry_s *)arg; - FAR struct netlink_conn_s *conn; - - DEBUGASSERT(notifier != NULL && notifier->info.qualifier != NULL); - conn = (FAR struct netlink_conn_s *)notifier->info.qualifier; - - /* Free the notifier entry */ - - kmm_free(notifier); + DEBUGASSERT(conn != NULL); /* The following should always be true ... but maybe not in some race * condition? diff --git a/net/tcp/tcp_notifier.c b/net/tcp/tcp_notifier.c index acd6404854..abccf3198f 100644 --- a/net/tcp/tcp_notifier.c +++ b/net/tcp/tcp_notifier.c @@ -269,7 +269,7 @@ void tcp_readahead_signal(FAR struct tcp_conn_s *conn) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_TCP_READAHEAD, conn); + work_notifier_signal(WORK_TCP_READAHEAD, conn); } /**************************************************************************** @@ -298,7 +298,7 @@ void tcp_writebuffer_signal(FAR struct tcp_conn_s *conn) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_TCP_WRITEBUFFER, conn); + work_notifier_signal(WORK_TCP_WRITEBUFFER, conn); } #endif @@ -321,7 +321,7 @@ void tcp_disconnect_signal(FAR struct tcp_conn_s *conn) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_TCP_DISCONNECT, conn); + work_notifier_signal(WORK_TCP_DISCONNECT, conn); } #endif /* CONFIG_NET_TCP_NOTIFIER */ diff --git a/net/udp/udp_notifier.c b/net/udp/udp_notifier.c index 37a57f5d67..ddd0d80bbb 100644 --- a/net/udp/udp_notifier.c +++ b/net/udp/udp_notifier.c @@ -215,7 +215,7 @@ void udp_readahead_signal(FAR struct udp_conn_s *conn) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_UDP_READAHEAD, conn); + work_notifier_signal(WORK_UDP_READAHEAD, conn); } /**************************************************************************** @@ -244,7 +244,7 @@ void udp_writebuffer_signal(FAR struct udp_conn_s *conn) { /* This is just a simple wrapper around work_notifier_signal(). */ - return work_notifier_signal(WORK_UDP_WRITEBUFFER, conn); + work_notifier_signal(WORK_UDP_WRITEBUFFER, conn); } #endif