From 1f08c91e8f4fceb18f04c575ac7c032d7564a66c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Sun, 10 Jul 2022 13:38:07 +0200 Subject: [PATCH] ubifs: Use U-Boot assert() from in UBI/UBIFS code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit U-Boot already provides assert function, so it use also in ubi and ubifs code. Signed-off-by: Pali Rohár --- drivers/mtd/ubi/debug.h | 9 ++------- fs/ubifs/debug.h | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index 2c2faaf1b4..9c8ce51636 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h @@ -27,13 +27,8 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); } \ } while (0) #else -#define ubi_assert(expr) do { \ - if (unlikely(!(expr))) { \ - pr_debug("UBI assert failed in %s at %u\n", \ - __func__, __LINE__); \ - dump_stack(); \ - } \ -} while (0) +#include +#define ubi_assert(expr) assert(expr) #endif #define ubi_dbg_print_hex_dump(ps, pt, r, g, b, len, a) \ diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index d69f1e6ac7..0ecc2e0c8e 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h @@ -165,14 +165,9 @@ struct ubifs_global_debug_info { dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \ } while (0) #else -#define ubifs_assert(expr) do { \ - if (unlikely(!(expr))) { \ - pr_debug("UBIFS assert failed in %s at %u\n", \ - __func__, __LINE__); \ - dump_stack(); \ - } \ -} while (0) +#include +#define ubifs_assert(expr) assert(expr) #define ubifs_assert_cmt_locked(c) do { } while (0) #define ubifs_dbg_msg(type, fmt, ...) \ -- 2.39.5