Skip to content

Commit fb4a355

Browse files
paliJosephChen2017
authored andcommitted
UPSTREAM: 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. Change-Id: Ia88ff21d19ef155fd3e97c62f4b31bad1c8f78f5 Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Jon Lin <[email protected]> (cherry picked from commit e2e6caa)
1 parent 1ac561a commit fb4a355

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

drivers/mtd/ubi/debug.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,8 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
2828
} \
2929
} while (0)
3030
#else
31-
#define ubi_assert(expr) do { \
32-
if (unlikely(!(expr))) { \
33-
pr_debug("UBI assert failed in %s at %u\n", \
34-
__func__, __LINE__); \
35-
dump_stack(); \
36-
} \
37-
} while (0)
31+
#include <log.h>
32+
#define ubi_assert(expr) assert(expr)
3833
#endif
3934

4035
#define ubi_dbg_print_hex_dump(ps, pt, r, g, b, len, a) \

fs/ubifs/debug.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,9 @@ struct ubifs_global_debug_info {
166166
dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \
167167
} while (0)
168168
#else
169-
#define ubifs_assert(expr) do { \
170-
if (unlikely(!(expr))) { \
171-
pr_debug("UBIFS assert failed in %s at %u\n", \
172-
__func__, __LINE__); \
173-
dump_stack(); \
174-
} \
175-
} while (0)
176169

170+
#include <log.h>
171+
#define ubifs_assert(expr) assert(expr)
177172
#define ubifs_assert_cmt_locked(c) do { } while (0)
178173

179174
#define ubifs_dbg_msg(type, fmt, ...) \

0 commit comments

Comments
 (0)