diff --git a/components/drivers/smp/smp.c b/components/drivers/smp/smp.c index 3b6d9694ea..765d143061 100644 --- a/components/drivers/smp/smp.c +++ b/components/drivers/smp/smp.c @@ -14,9 +14,10 @@ #define DBG_LVL DBG_INFO #include -struct rt_smp_call rt_smp_work[RT_CPUS_NR]; -rt_atomic_t rt_smp_wait; -rt_err_t smp_call_handler(struct rt_smp_event *event) +static struct rt_smp_call rt_smp_work[RT_CPUS_NR]; +static rt_atomic_t rt_smp_wait; + +static rt_err_t smp_call_handler(struct rt_smp_event *event) { switch (event->event_id) { diff --git a/examples/utest/testcases/smp/smp.c b/examples/utest/testcases/smp/smp.c index f4326f5f42..e7bbcbe199 100644 --- a/examples/utest/testcases/smp/smp.c +++ b/examples/utest/testcases/smp/smp.c @@ -2,11 +2,11 @@ #include "utest.h" #include "utest_assert.h" #include "smp.h" -int pass_count = 0; -int pass = 1000; -struct rt_spinlock lock; +static int pass_count = 0; +static int pass = 1000; +static struct rt_spinlock lock; -void test_call(void *data) +static void test_call(void *data) { rt_spin_lock(&lock); int *i = (int *)data; @@ -18,7 +18,7 @@ void test_call(void *data) } -void test1() +static void test1() { int cpu_mask = 0xf; for (int i = 0; i < 1000; i++) @@ -34,7 +34,7 @@ void test1() uassert_true(pass_count == pass); } -void test_call2(void *data) +static void test_call2(void *data) { rt_spin_lock(&lock); int a = 100000; @@ -43,7 +43,7 @@ void test_call2(void *data) (*i)++; rt_spin_unlock(&lock); } -void test2(void) +static void test2(void) { int data = 0; rt_smp_call_each_cpu(test_call2, &data, SMP_CALL_WAIT_ALL);