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

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

commit 64e7e43f1fbc8c9f8949836539c5e75d866ac650
Author: yinshengkai <yinsheng...@xiaomi.com>
AuthorDate: Wed Mar 15 12:03:23 2023 +0800

    drivers/note: adjust the note_driver_ops definition
    
    Signed-off-by: yinshengkai <yinsheng...@xiaomi.com>
---
 drivers/note/notelog_driver.c    | 8 ++++++--
 drivers/note/notesnap_driver.c   | 8 ++++++--
 drivers/segger/note_sysview.c    | 4 +++-
 include/nuttx/note/note_driver.h | 4 +++-
 4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/note/notelog_driver.c b/drivers/note/notelog_driver.c
index 79798f8d48..e311e5ec63 100644
--- a/drivers/note/notelog_driver.c
+++ b/drivers/note/notelog_driver.c
@@ -41,11 +41,13 @@ static void notelog_suspend(FAR struct note_driver_s *drv,
                             FAR struct tcb_s *tcb);
 static void notelog_resume(FAR struct note_driver_s *drv,
                            FAR struct tcb_s *tcb);
-#  ifdef CONFIG_SMP
+#endif
+#ifdef CONFIG_SMP
 static void notelog_cpu_start(FAR struct note_driver_s *drv,
                               FAR struct tcb_s *tcb, int cpu);
 static void notelog_cpu_started(FAR struct note_driver_s *drv,
                                 FAR struct tcb_s *tcb);
+#  ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
 static void notelog_cpu_pause(FAR struct note_driver_s *drv,
                               FAR struct tcb_s *tcb, int cpu);
 static void notelog_cpu_paused(FAR struct note_driver_s *drv,
@@ -87,14 +89,16 @@ static const struct note_driver_ops_s g_notelog_ops =
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   notelog_suspend,       /* suspend */
   notelog_resume,        /* resume */
+#endif
 #ifdef CONFIG_SMP
   notelog_cpu_start,     /* cpu_start */
   notelog_cpu_started,   /* cpu_started */
+#  ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   notelog_cpu_pause,     /* cpu_pause */
   notelog_cpu_paused,    /* cpu_paused */
   notelog_cpu_resume,    /* cpu_resume */
   notelog_cpu_resumed,   /* cpu_resumed */
-#endif
+#  endif
 #endif
 #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
   notelog_premption,     /* premption */
diff --git a/drivers/note/notesnap_driver.c b/drivers/note/notesnap_driver.c
index 603013ff27..ef2b07e7b9 100644
--- a/drivers/note/notesnap_driver.c
+++ b/drivers/note/notesnap_driver.c
@@ -71,11 +71,13 @@ static void notesnap_suspend(FAR struct note_driver_s *drv,
                              FAR struct tcb_s *tcb);
 static void notesnap_resume(FAR struct note_driver_s *drv,
                             FAR struct tcb_s *tcb);
-#  ifdef CONFIG_SMP
+#endif
+#ifdef CONFIG_SMP
 static void notesnap_cpu_start(FAR struct note_driver_s *drv,
                                FAR struct tcb_s *tcb, int cpu);
 static void notesnap_cpu_started(FAR struct note_driver_s *drv,
                                  FAR struct tcb_s *tcb);
+#  ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
 static void notesnap_cpu_pause(FAR struct note_driver_s *drv,
                                FAR struct tcb_s *tcb, int cpu);
 static void notesnap_cpu_paused(FAR struct note_driver_s *drv,
@@ -122,9 +124,11 @@ static const struct note_driver_ops_s g_notesnap_ops =
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   notesnap_suspend,
   notesnap_resume,
-#  ifdef CONFIG_SMP
+#endif
+#ifdef CONFIG_SMP
   notesnap_cpu_start,
   notesnap_cpu_started,
+#  ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   notesnap_cpu_pause,
   notesnap_cpu_paused,
   notesnap_cpu_resume,
diff --git a/drivers/segger/note_sysview.c b/drivers/segger/note_sysview.c
index 7e4d8baf36..7b60c539e3 100644
--- a/drivers/segger/note_sysview.c
+++ b/drivers/segger/note_sysview.c
@@ -86,9 +86,11 @@ static const struct note_driver_ops_s g_note_sysview_ops =
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   note_sysview_suspend,       /* suspend */
   note_sysview_resume,        /* resume */
-#  ifdef CONFIG_SMP
+#endif
+#ifdef CONFIG_SMP
   NULL,                       /* cpu_start */
   NULL,                       /* cpu_started */
+#  ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   NULL,                       /* cpu_pause */
   NULL,                       /* cpu_paused */
   NULL,                       /* cpu_resume */
diff --git a/include/nuttx/note/note_driver.h b/include/nuttx/note/note_driver.h
index 097441e9c5..fe30b94864 100644
--- a/include/nuttx/note/note_driver.h
+++ b/include/nuttx/note/note_driver.h
@@ -50,11 +50,13 @@ struct note_driver_ops_s
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   CODE void (*suspend)(FAR struct note_driver_s *drv, FAR struct tcb_s *tcb);
   CODE void (*resume)(FAR struct note_driver_s *drv, FAR struct tcb_s *tcb);
-#  ifdef CONFIG_SMP
+#endif
+#ifdef CONFIG_SMP
   CODE void (*cpu_start)(FAR struct note_driver_s *drv,
                          FAR struct tcb_s *tcb, int cpu);
   CODE void (*cpu_started)(FAR struct note_driver_s *drv,
                            FAR struct tcb_s *tcb);
+#  ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
   CODE void (*cpu_pause)(FAR struct note_driver_s *drv,
                          FAR struct tcb_s *tcb, int cpu);
   CODE void (*cpu_paused)(FAR struct note_driver_s *drv,

Reply via email to