You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/01/21 07:59:05 UTC
[incubator-nuttx] branch master updated: wqueue/notifier: update
the work notifier usage
This is an automated email from the ASF dual-hosted git repository.
jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new a4aa8ae wqueue/notifier: update the work notifier usage
new 6694a16 Merge pull request #133 from xiaoxiang781216/fix-netlink-notifier
a4aa8ae is described below
commit a4aa8ae4912194d57340d71afeb9181792b39299
Author: chao.an <an...@xiaomi.com>
AuthorDate: Sun Jan 19 17:44:27 2020 +0800
wqueue/notifier: update the work notifier usage
usage changed after commit 90c52e6f8f7efce97ac718c0f98addc13ec880d2
Change-Id: Ifb0d739b046a6794b5b3ac177f489fb9a1c5c799
Signed-off-by: chao.an <an...@xiaomi.com>
---
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 0a7015c..041a6e0 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 371fbbe..e726a53 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 6fad4bc..061f3cf 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 d00d773..c9f37db 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 378cbae..40d8d3d 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 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 */
+ FAR struct netlink_conn_s *conn = arg;
- 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 acd6404..abccf31 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 37a57f5..ddd0d80 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