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

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

commit 5da6ac128fd4ca5da7bbfdac485475e0a3e543b0
Author: p-szafonimateusz <[email protected]>
AuthorDate: Mon Nov 9 11:51:10 2026 +0100

    net/can: Move can_notifier.c into can.c.
    
    Move the code of can_notifier.c into can.c without changes and remove
    can_notifier.c.  Only the include lists and the file guards are merged; the
    functions are copied as they are.
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: p-szafonimateusz <[email protected]>
---
 .github/CODEOWNERS     |  1 -
 net/can/CMakeLists.txt |  4 ---
 net/can/Make.defs      |  4 ---
 net/can/can.c          | 32 +++++++++++++++++++++++
 net/can/can_notifier.c | 70 --------------------------------------------------
 5 files changed, 32 insertions(+), 79 deletions(-)

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index f00c229aa9e..162955020b7 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -15893,7 +15893,6 @@ net/can/Kconfig [email protected] 
[email protected] [email protected] raide
 net/can/can.c [email protected] [email protected] [email protected] 
[email protected] [email protected]
 net/can/can.h [email protected] [email protected] 
[email protected] [email protected] [email protected]
 net/can/can_getsockopt.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
-net/can/can_notifier.c [email protected] [email protected]
 net/can/can_recvmsg.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
 net/can/can_sendmsg.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
 net/can/can_setsockopt.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
diff --git a/net/can/CMakeLists.txt b/net/can/CMakeLists.txt
index 694abcbad62..6d7838d1a2b 100644
--- a/net/can/CMakeLists.txt
+++ b/net/can/CMakeLists.txt
@@ -31,10 +31,6 @@ if(CONFIG_NET_CAN)
     list(APPEND SRCS can_sendmsg.c)
   endif()
 
-  if(CONFIG_NET_CAN_NOTIFIER)
-    list(APPEND SRCS can_notifier.c)
-  endif()
-
   if(CONFIG_NET_CANPROTO_OPTIONS)
     list(APPEND SRCS can_setsockopt.c can_getsockopt.c)
   endif()
diff --git a/net/can/Make.defs b/net/can/Make.defs
index 0372afb9d63..79f95562d4c 100644
--- a/net/can/Make.defs
+++ b/net/can/Make.defs
@@ -35,10 +35,6 @@ endif
 
 SOCK_CSRCS += can_recvmsg.c
 
-ifeq ($(CONFIG_NET_CAN_NOTIFIER),y)
-SOCK_CSRCS += can_notifier.c
-endif
-
 ifeq ($(CONFIG_NET_CANPROTO_OPTIONS),y)
 SOCK_CSRCS += can_setsockopt.c can_getsockopt.c
 endif
diff --git a/net/can/can.c b/net/can/can.c
index 227ae61856c..dafcb167d40 100644
--- a/net/can/can.c
+++ b/net/can/can.c
@@ -33,6 +33,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <sys/time.h>
+#include <sys/types.h>
 
 #include <arch/irq.h>
 
@@ -46,6 +47,7 @@
 #include <nuttx/net/netdev.h>
 #include <nuttx/net/netstats.h>
 #include <nuttx/queue.h>
+#include <nuttx/wqueue.h>
 
 #include "can/can.h"
 #include "devif/devif.h"
@@ -583,6 +585,36 @@ void can_poll(FAR struct net_driver_s *dev, FAR struct 
can_conn_s *conn)
   dev->d_len = 0;
 }
 
+#ifdef CONFIG_NET_CAN_NOTIFIER
+/****************************************************************************
+ * Name: can_readahead_signal
+ *
+ * Description:
+ *   Read-ahead data has been buffered.  Signal all threads waiting for
+ *   read-ahead data to become available.
+ *
+ *   When read-ahead data becomes available, *all* of the workers waiting
+ *   for read-ahead data will be executed.  If there are multiple workers
+ *   waiting for read-ahead data then only the first to execute will get the
+ *   data.  Others will need to call can_readahead_notifier_setup() once
+ *   again.
+ *
+ * Input Parameters:
+ *   conn  - The CAN connection where read-ahead data was just buffered.
+ *
+ * Returned Value:
+ *   None.
+ *
+ ****************************************************************************/
+
+void can_readahead_signal(FAR struct can_conn_s *conn)
+{
+  /* This is just a simple wrapper around work_notifier_signal(). */
+
+  work_notifier_signal(WORK_CAN_READAHEAD, conn);
+}
+#endif
+
 /****************************************************************************
  * Name: can_alloc()
  *
diff --git a/net/can/can_notifier.c b/net/can/can_notifier.c
deleted file mode 100644
index bed3e130062..00000000000
--- a/net/can/can_notifier.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
- * net/can/can_notifier.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <sys/types.h>
-#include <assert.h>
-
-#include <nuttx/wqueue.h>
-
-#include "can/can.h"
-
-#ifdef CONFIG_NET_CAN_NOTIFIER
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: can_readahead_signal
- *
- * Description:
- *   Read-ahead data has been buffered.  Signal all threads waiting for
- *   read-ahead data to become available.
- *
- *   When read-ahead data becomes available, *all* of the workers waiting
- *   for read-ahead data will be executed.  If there are multiple workers
- *   waiting for read-ahead data then only the first to execute will get the
- *   data.  Others will need to call can_readahead_notifier_setup() once
- *   again.
- *
- * Input Parameters:
- *   conn  - The CAN connection where read-ahead data was just buffered.
- *
- * Returned Value:
- *   None.
- *
- ****************************************************************************/
-
-void can_readahead_signal(FAR struct can_conn_s *conn)
-{
-  /* This is just a simple wrapper around work_notifier_signal(). */
-
-  work_notifier_signal(WORK_CAN_READAHEAD, conn);
-}
-
-#endif /* CONFIG_NET_CAN_NOTIFIER */

Reply via email to