From: Peter Feiner <pfeiner@xxxxxxxxxx> Signed-off-by: Peter Feiner <pfeiner@xxxxxxxxxx> Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx> --- lib/libcflat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/libcflat.h b/lib/libcflat.h index 1d2eba980e1a..5d356df75f1f 100644 --- a/lib/libcflat.h +++ b/lib/libcflat.h @@ -126,6 +126,16 @@ do { \ } \ } while (0) +#define assert_msg(cond, fmt, args...) \ +do { \ + if (!(cond)) { \ + printf("%s:%d: assert failed: %s: " fmt, \ + __FILE__, __LINE__, #cond, ## args); \ + dump_stack(); \ + abort(); \ + } \ +} while (0) + static inline bool is_power_of_2(unsigned long n) { return n && !(n & (n - 1)); -- 2.12.2.816.g2cccc81164-goog