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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9c97f7adaa sched/cpuload: move g_cpuload_wdog to private chapter
9c97f7adaa is described below

commit 9c97f7adaa9ad1e653ca115e581eab3454d7cba6
Author: chao an <[email protected]>
AuthorDate: Fri Oct 25 11:46:36 2024 +0800

    sched/cpuload: move g_cpuload_wdog to private chapter
    
    coding style
    
    Signed-off-by: chao an <[email protected]>
---
 sched/sched/sched_cpuload.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sched/sched/sched_cpuload.c b/sched/sched/sched_cpuload.c
index a5b5b81eaa..9ded4668ac 100644
--- a/sched/sched/sched_cpuload.c
+++ b/sched/sched/sched_cpuload.c
@@ -86,6 +86,14 @@
 
 volatile clock_t g_cpuload_total;
 
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_CPULOAD_SYSCLK
+static struct wdog_s g_cpuload_wdog;
+#endif
+
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
@@ -279,7 +287,6 @@ int clock_cpuload(int pid, FAR struct cpuload_s *cpuload)
 #ifdef CONFIG_SCHED_CPULOAD_SYSCLK
 void cpuload_init(void)
 {
-  static struct wdog_s g_cpuload_wdog;
   wd_start(&g_cpuload_wdog, CPULOAD_SAMPLING_PERIOD, cpuload_callback,
            (wdparm_t)&g_cpuload_wdog);
 }

Reply via email to