Bladeren bron

[ci] fix errors under strick compiling mode

Meco Man 1 jaar geleden
bovenliggende
commit
bd228eb9c5
7 gewijzigde bestanden met toevoegingen van 58 en 21 verwijderingen
  1. 2 0
      components/lwp/lwp_user_mm.h
  2. 38 11
      libcpu/risc-v/virt64/cache.h
  3. 2 0
      src/idle.c
  4. 10 0
      src/kservice.c
  5. 0 10
      src/mem.c
  6. 3 0
      src/scheduler_mp.c
  7. 3 0
      src/signal.c

+ 2 - 0
components/lwp/lwp_user_mm.h

@@ -207,6 +207,8 @@ rt_inline rt_size_t lwp_user_mm_flag_to_kernel(int flags)
 
 rt_inline rt_size_t lwp_user_mm_attr_to_kernel(int prot)
 {
+    RT_UNUSED(prot);
+
     rt_size_t k_attr = 0;
 
 #ifdef IMPL_MPROTECT

+ 38 - 11
libcpu/risc-v/virt64/cache.h

@@ -10,25 +10,52 @@
 #ifndef __CACHE_H__
 #define __CACHE_H__
 
-#ifndef ALWAYS_INLINE
-#define ALWAYS_INLINE inline __attribute__((always_inline))
-#endif
+#include <rtdef.h>
 
 /**
  * @brief These APIs may not be supported by a specified architecture
  * But we have to include to all the cases to be 'general purpose'
  */
 
-ALWAYS_INLINE void rt_hw_cpu_dcache_clean_local(void *addr, int size) {}
-ALWAYS_INLINE void rt_hw_cpu_dcache_invalidate_local(void *addr, int size) {}
-ALWAYS_INLINE void rt_hw_cpu_dcache_clean_and_invalidate_local(void *addr, int size) {}
+rt_always_inline void rt_hw_cpu_dcache_clean_local(void *addr, int size)
+{
+    RT_UNUSED(addr);
+    RT_UNUSED(size);
+}
 
-ALWAYS_INLINE void rt_hw_cpu_dcache_clean_all_local() {}
-ALWAYS_INLINE void rt_hw_cpu_dcache_invalidate_all_local(void) {}
-ALWAYS_INLINE void rt_hw_cpu_dcache_clean_and_invalidate_all_local(void) {}
+rt_always_inline void rt_hw_cpu_dcache_invalidate_local(void *addr, int size)
+{
+    RT_UNUSED(addr);
+    RT_UNUSED(size);
+}
 
-ALWAYS_INLINE void rt_hw_cpu_icache_invalidate_local(void *addr, int size) {}
-ALWAYS_INLINE void rt_hw_cpu_icache_invalidate_all_local() {}
+rt_always_inline void rt_hw_cpu_dcache_clean_and_invalidate_local(void *addr, int size)
+{
+    RT_UNUSED(addr);
+    RT_UNUSED(size);
+}
+
+rt_always_inline void rt_hw_cpu_dcache_clean_all_local(void)
+{
+}
+
+rt_always_inline void rt_hw_cpu_dcache_invalidate_all_local(void)
+{
+}
+
+rt_always_inline void rt_hw_cpu_dcache_clean_and_invalidate_all_local(void)
+{
+}
+
+rt_always_inline void rt_hw_cpu_icache_invalidate_local(void *addr, int size)
+{
+    RT_UNUSED(addr);
+    RT_UNUSED(size);
+}
+
+rt_always_inline void rt_hw_cpu_icache_invalidate_all_local(void)
+{
+}
 
 /**
  * @brief Multi-core

+ 2 - 0
src/idle.c

@@ -304,6 +304,8 @@ static void idle_thread_entry(void *parameter)
 #ifdef RT_USING_SMP
 static void rt_thread_system_entry(void *parameter)
 {
+    RT_UNUSED(parameter);
+
     while (1)
     {
         int ret= rt_sem_take(&system_sem, RT_WAITING_FOREVER);

+ 10 - 0
src/kservice.c

@@ -1026,6 +1026,11 @@ static char *print_number(char *buf,
     return buf;
 }
 
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+/* ignore warning: this statement may fall through */
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#endif /* __GNUC__ */
 /**
  * @brief  This function will fill a formatted string to buffer.
  *
@@ -1345,6 +1350,9 @@ rt_weak int rt_vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list arg
     return str - buf;
 }
 RTM_EXPORT(rt_vsnprintf);
+#ifdef __GNUC__
+#pragma GCC diagnostic pop /* ignored "-Wimplicit-fallthrough" */
+#endif /* __GNUC__ */
 
 /**
  * @brief  This function will fill a formatted string to buffer.
@@ -1568,6 +1576,8 @@ static void _console_release(void)
  */
 static void _kputs(const char *str, long len)
 {
+    RT_UNUSED(len);
+
     CONSOLE_TAKE;
 
 #ifdef RT_USING_DEVICE

+ 0 - 10
src/mem.c

@@ -290,16 +290,6 @@ void *rt_smem_alloc(rt_smem_t m, rt_size_t size)
     RT_ASSERT(rt_object_get_type(&m->parent) == RT_Object_Class_Memory);
     RT_ASSERT(rt_object_is_systemobject(&m->parent));
 
-    if (size != RT_ALIGN(size, RT_ALIGN_SIZE))
-    {
-        LOG_D("malloc size %d, but align to %d",
-                size, RT_ALIGN(size, RT_ALIGN_SIZE));
-    }
-    else
-    {
-        LOG_D("malloc size %d", size);
-    }
-
     small_mem = (struct rt_small_mem *)m;
     /* alignment size */
     size = RT_ALIGN(size, RT_ALIGN_SIZE);

+ 3 - 0
src/scheduler_mp.c

@@ -249,6 +249,9 @@ void rt_system_scheduler_init(void)
  */
 void rt_scheduler_ipi_handler(int vector, void *param)
 {
+    RT_UNUSED(vector);
+    RT_UNUSED(param);
+
     rt_schedule();
 }
 

+ 3 - 0
src/signal.c

@@ -41,12 +41,15 @@ void rt_thread_handle_sig(rt_bool_t clean_state);
 
 static void _signal_default_handler(int signo)
 {
+    RT_UNUSED(signo);
     LOG_I("handled signo[%d] with default action.", signo);
     return ;
 }
 
 static void _signal_entry(void *parameter)
 {
+    RT_UNUSED(parameter);
+
     rt_thread_t tid = rt_thread_self();
 
     /* handle signal */