Revision | e2e6caa01ba97bcdb82100c6b928b5743e3aae6c (tree) |
---|---|
Time | 2022-07-20 12:50:13 |
Author | Pali Rohár <pali@kern...> |
Commiter | Heiko Schocher |
ubifs: Use U-Boot assert() from <log.h> in UBI/UBIFS code
U-Boot already provides assert function, so it use also in ubi and ubifs code.
Signed-off-by: Pali Rohár <pali@kernel.org>
@@ -27,13 +27,8 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); | ||
27 | 27 | } \ |
28 | 28 | } while (0) |
29 | 29 | #else |
30 | -#define ubi_assert(expr) do { \ | |
31 | - if (unlikely(!(expr))) { \ | |
32 | - pr_debug("UBI assert failed in %s at %u\n", \ | |
33 | - __func__, __LINE__); \ | |
34 | - dump_stack(); \ | |
35 | - } \ | |
36 | -} while (0) | |
30 | +#include <log.h> | |
31 | +#define ubi_assert(expr) assert(expr) | |
37 | 32 | #endif |
38 | 33 | |
39 | 34 | #define ubi_dbg_print_hex_dump(ps, pt, r, g, b, len, a) \ |
@@ -165,14 +165,9 @@ struct ubifs_global_debug_info { | ||
165 | 165 | dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \ |
166 | 166 | } while (0) |
167 | 167 | #else |
168 | -#define ubifs_assert(expr) do { \ | |
169 | - if (unlikely(!(expr))) { \ | |
170 | - pr_debug("UBIFS assert failed in %s at %u\n", \ | |
171 | - __func__, __LINE__); \ | |
172 | - dump_stack(); \ | |
173 | - } \ | |
174 | -} while (0) | |
175 | 168 | |
169 | +#include <log.h> | |
170 | +#define ubifs_assert(expr) assert(expr) | |
176 | 171 | #define ubifs_assert_cmt_locked(c) do { } while (0) |
177 | 172 | |
178 | 173 | #define ubifs_dbg_msg(type, fmt, ...) \ |