Browse Source

[kernel] skip warning when disable debug.

Bernard Xiong 6 years ago
parent
commit
3463a756d9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/object.c

+ 4 - 1
src/object.c

@@ -262,7 +262,10 @@ void rt_object_init(struct rt_object         *object,
         struct rt_object *obj;
 
         obj = rt_list_entry(node, struct rt_object, list);
-        RT_ASSERT(obj != object);
+        if (obj) /* skip warning when disable debug */
+        {
+            RT_ASSERT(obj != object);
+        }
     }
     /* leave critical */
     rt_exit_critical();