Skip to contentSkip to conversation

log: document the assign() macro

PATCH New Heinrich Schuchardt 2 participants 2 messages Jul 27, 2019 – Aug 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 log: document the assign() macro

Provide a concise description of the assert() macro. Point out that the tested expression is always executed, irrespective of the value of _DEBUG.

---
 include/log.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
include/log.h +12 -0
index 7566ba7f2d..6d15e955d7 100644
@@ -183,6 +183,18 @@ int _log(enum log_category_t cat, enum log_level_t level, const char *file,
  */
 void __assert_fail(const char *assertion, const char *file, unsigned int line,
 		   const char *function);
+
+/**
+ * assert() - assert expression is true
+ *
+ * If the expression x evaluates to false and _DEBUG evaluates to true, a panic
+ * message is written and the system stalls. The value of _DEBUG is set to true
+ * if DEBUG is defined before including common.h.
+ *
+ * The expression x is always executed irrespective of the value of _DEBUG.
+ *
+ * @x:		expression to test
+ */
 #define assert(x) \
 	({ if (!(x) && _DEBUG) \
 		__assert_fail(#x, __FILE__, __LINE__, __func__); })

--
2.20.1

#1 lore raw

PATCH 1/1 log: document the assign() macro

Quoted 4 lines · Heinrich Schuchardt

Provide a concise description of the assert() macro. Point out that the tested expression is always executed, irrespective of the value of _DEBUG.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190807/8a229e4c/attachment.sig>