This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 9072eecc30f8d118ad4ba80582deecb534e3fb02
Author: Xiang Xiao <[email protected]>
AuthorDate: Fri May 13 18:26:42 2022 +0800

    sched/wqueue: Change the return type of work_notifier_teardown to void
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 drivers/usbhost/usbhost_storage.c |  7 +++----
 include/nuttx/mm/iob.h            |  5 ++---
 include/nuttx/usb/usbhost.h       |  5 ++---
 include/nuttx/wqueue.h            |  5 ++---
 mm/iob/iob_notifier.c             |  7 +++----
 net/netdev/netdev.h               |  5 ++---
 net/netdev/netdown_notifier.c     |  7 +++----
 net/tcp/tcp.h                     |  5 ++---
 net/tcp/tcp_notifier.c            |  7 +++----
 net/udp/udp.h                     |  5 ++---
 net/udp/udp_notifier.c            |  7 +++----
 sched/wqueue/kwork_notifier.c     | 15 +++------------
 12 files changed, 30 insertions(+), 50 deletions(-)

diff --git a/drivers/usbhost/usbhost_storage.c 
b/drivers/usbhost/usbhost_storage.c
index 4c09e77bdf..55048330de 100644
--- a/drivers/usbhost/usbhost_storage.c
+++ b/drivers/usbhost/usbhost_storage.c
@@ -2435,16 +2435,15 @@ int usbhost_msc_notifier_setup(worker_t worker, uint8_t 
event, char sdchar,
  *         usbhost_msc_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int usbhost_msc_notifier_teardown(int key)
+void usbhost_msc_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index e64130d748..68224a5221 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -349,13 +349,12 @@ int iob_notifier_setup(int qid, worker_t worker, FAR void 
*arg);
  *         iob_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_IOB_NOTIFIER
-int iob_notifier_teardown(int key);
+void iob_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/include/nuttx/usb/usbhost.h b/include/nuttx/usb/usbhost.h
index 709e923b6c..7d220bf141 100644
--- a/include/nuttx/usb/usbhost.h
+++ b/include/nuttx/usb/usbhost.h
@@ -1093,12 +1093,11 @@ int usbhost_msc_notifier_setup(worker_t worker, uint8_t 
event, char sdchar,
  *         usbhost_msc_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int usbhost_msc_notifier_teardown(int key);
+void usbhost_msc_notifier_teardown(int key);
 
 /****************************************************************************
  * Name: usbhost_msc_notifier_signal
diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h
index 7ab1e81e05..bd91068748 100644
--- a/include/nuttx/wqueue.h
+++ b/include/nuttx/wqueue.h
@@ -500,13 +500,12 @@ int work_notifier_setup(FAR struct work_notifier_s *info);
  *         work_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_WQUEUE_NOTIFIER
-int work_notifier_teardown(int key);
+void work_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/mm/iob/iob_notifier.c b/mm/iob/iob_notifier.c
index 19bb383280..d645df8466 100644
--- a/mm/iob/iob_notifier.c
+++ b/mm/iob/iob_notifier.c
@@ -92,16 +92,15 @@ int iob_notifier_setup(int qid, worker_t worker, FAR void 
*arg)
  *         iob_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int iob_notifier_teardown(int key)
+void iob_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/net/netdev/netdev.h b/net/netdev/netdev.h
index bc47544091..a4a7659397 100644
--- a/net/netdev/netdev.h
+++ b/net/netdev/netdev.h
@@ -478,13 +478,12 @@ int netdown_notifier_setup(worker_t worker, FAR struct 
net_driver_s *dev,
  *         netdown_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_NETDOWN_NOTIFIER
-int netdown_notifier_teardown(int key);
+void netdown_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/net/netdev/netdown_notifier.c b/net/netdev/netdown_notifier.c
index 4dfa714173..54d05fbbd1 100644
--- a/net/netdev/netdown_notifier.c
+++ b/net/netdev/netdown_notifier.c
@@ -105,16 +105,15 @@ int netdown_notifier_setup(worker_t worker, FAR struct 
net_driver_s *dev,
  *         netdown_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int netdown_notifier_teardown(int key)
+void netdown_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h
index 308885ddd3..3957c25cec 100644
--- a/net/tcp/tcp.h
+++ b/net/tcp/tcp.h
@@ -1830,13 +1830,12 @@ int tcp_disconnect_notifier_setup(worker_t worker,
  *         tcp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_NET_TCP_NOTIFIER
-int tcp_notifier_teardown(int key);
+void tcp_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/net/tcp/tcp_notifier.c b/net/tcp/tcp_notifier.c
index 00b10a4de1..9b9609303e 100644
--- a/net/tcp/tcp_notifier.c
+++ b/net/tcp/tcp_notifier.c
@@ -217,16 +217,15 @@ int tcp_disconnect_notifier_setup(worker_t worker,
  *         tcp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int tcp_notifier_teardown(int key)
+void tcp_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/net/udp/udp.h b/net/udp/udp.h
index 03daa0ae25..966183f44f 100644
--- a/net/udp/udp.h
+++ b/net/udp/udp.h
@@ -832,13 +832,12 @@ int udp_writebuffer_notifier_setup(worker_t worker,
  *         udp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_NET_UDP_NOTIFIER
-int udp_notifier_teardown(int key);
+void udp_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/net/udp/udp_notifier.c b/net/udp/udp_notifier.c
index ff37e9afeb..21f16b0548 100644
--- a/net/udp/udp_notifier.c
+++ b/net/udp/udp_notifier.c
@@ -164,16 +164,15 @@ int udp_writebuffer_notifier_setup(worker_t worker,
  *         udp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int udp_notifier_teardown(int key)
+void udp_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/sched/wqueue/kwork_notifier.c b/sched/wqueue/kwork_notifier.c
index 09cb1a683b..7aee208446 100644
--- a/sched/wqueue/kwork_notifier.c
+++ b/sched/wqueue/kwork_notifier.c
@@ -276,16 +276,14 @@ int work_notifier_setup(FAR struct work_notifier_s *info)
  *         work_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int work_notifier_teardown(int key)
+void work_notifier_teardown(int key)
 {
   FAR struct work_notifier_entry_s *notifier;
   irqstate_t flags;
-  int ret = OK;
 
   /* Disable interrupts very briefly. */
 
@@ -296,13 +294,7 @@ int work_notifier_teardown(int key)
    */
 
   notifier = work_notifier_find(key);
-  if (notifier == NULL)
-    {
-      /* There is no notification with this key in the pending list */
-
-      ret = -ENOENT;
-    }
-  else
+  if (notifier != NULL)
     {
       /* Found it!  Remove the notification from the pending list */
 
@@ -314,7 +306,6 @@ int work_notifier_teardown(int key)
     }
 
   leave_critical_section(flags);
-  return ret;
 }
 
 /****************************************************************************

Reply via email to