include/compiler: replace likely to predict_true

likely is defined repeatedly in an external library

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai
2023-03-21 12:09:45 -03:00
committed by Alan Carvalho de Assis
parent b91042e5a0
commit 216483f96b
2 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -50,11 +50,11 @@
#define PANIC() __assert(__FILE__, __LINE__, "panic")
#ifdef CONFIG_DEBUG_ASSERTIONS_EXPRESSION
#define ASSERT(f) do { if (unlikely(!(f))) __assert(__FILE__, __LINE__, #f); } while (0)
#define VERIFY(f) do { if (unlikely((f) < 0)) __assert(__FILE__, __LINE__, #f); } while (0)
#define ASSERT(f) do { if (predict_false(!(f))) __assert(__FILE__, __LINE__, #f); } while (0)
#define VERIFY(f) do { if (predict_false((f) < 0)) __assert(__FILE__, __LINE__, #f); } while (0)
#else
#define ASSERT(f) do { if (unlikely(!(f))) __assert(__FILE__, __LINE__, NULL); } while (0)
#define VERIFY(f) do { if (unlikely((f) < 0)) __assert(__FILE__, __LINE__, NULL); } while (0)
#define ASSERT(f) do { if (predict_false(!(f))) __assert(__FILE__, __LINE__, NULL); } while (0)
#define VERIFY(f) do { if (predict_false((f) < 0)) __assert(__FILE__, __LINE__, NULL); } while (0)
#endif
#ifdef CONFIG_DEBUG_ASSERTIONS