From 66e78fc196f59a9cd2688effa4d4d2eea32b0ed5 Mon Sep 17 00:00:00 2001 From: Eran Matityahu Date: Wed, 13 Feb 2019 20:55:43 +0200 Subject: mtd: ubi debug: Remove the pid print from ubi_assert Add a new definition for ubi_assert and keep the original one in an ifndef __UBOOT__. Signed-off-by: Eran Matityahu Reviewed-by: Heiko Schocher --- drivers/mtd/ubi/debug.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index 8ad0c62733f..d853520108f 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h @@ -18,6 +18,7 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); #include +#ifndef __UBOOT__ #define ubi_assert(expr) do { \ if (unlikely(!(expr))) { \ pr_crit("UBI assert failed in %s at %u (pid %d)\n", \ @@ -25,6 +26,15 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); dump_stack(); \ } \ } while (0) +#else +#define ubi_assert(expr) do { \ + if (unlikely(!(expr))) { \ + pr_crit("UBI assert failed in %s at %u\n", \ + __func__, __LINE__); \ + dump_stack(); \ + } \ +} while (0) +#endif #define ubi_dbg_print_hex_dump(ps, pt, r, g, b, len, a) \ print_hex_dump(ps, pt, r, g, b, len, a) -- cgit v1.2.3 From 734b080e78805edbb3430a52c8c5b1aeee02bd9f Mon Sep 17 00:00:00 2001 From: Eran Matityahu Date: Wed, 13 Feb 2019 20:56:17 +0200 Subject: mtd: ubi, ubifs debug: Use pr_debug instead of pr_crit Before printk.h was introduced and MTDDEBUG was removed, pr_crit() was calling MTDDEBUG(), which was since then replaced by the current pr_debug(). pr_debug is more appropriate here. Signed-off-by: Eran Matityahu Reviewed-by: Heiko Schocher --- drivers/mtd/ubi/debug.h | 2 +- fs/ubifs/debug.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index d853520108f..2c2faaf1b4d 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h @@ -29,7 +29,7 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); #else #define ubi_assert(expr) do { \ if (unlikely(!(expr))) { \ - pr_crit("UBI assert failed in %s at %u\n", \ + pr_debug("UBI assert failed in %s at %u\n", \ __func__, __LINE__); \ dump_stack(); \ } \ diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index bad0c67f5da..5f6e12702de 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h @@ -167,7 +167,7 @@ struct ubifs_global_debug_info { #else #define ubifs_assert(expr) do { \ if (unlikely(!(expr))) { \ - pr_crit("UBIFS assert failed in %s at %u\n", \ + pr_debug("UBIFS assert failed in %s at %u\n", \ __func__, __LINE__); \ dump_stack(); \ } \ @@ -176,7 +176,7 @@ struct ubifs_global_debug_info { #define ubifs_assert_cmt_locked(c) do { \ if (unlikely(down_write_trylock(&(c)->commit_sem))) { \ up_write(&(c)->commit_sem); \ - pr_crit("commit lock is not locked!\n"); \ + pr_debug("commit lock is not locked!\n"); \ ubifs_assert(0); \ } \ } while (0) -- cgit v1.2.3