public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eran Matityahu <eran.m@variscite.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert
Date: Wed, 13 Feb 2019 20:55:43 +0200	[thread overview]
Message-ID: <20190213185543.GA8209@ubuntu> (raw)

Add a new definition for ubi_assert and keep
the original one in an ifndef __UBOOT__.

Signed-off-by: Eran Matityahu <eran.m@variscite.com>
---
 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 8ad0c62..d853520 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 <hexdump.h>
 
+#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)
-- 
1.9.1

             reply	other threads:[~2019-02-13 18:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 18:55 Eran Matityahu [this message]
2019-02-18  5:06 ` [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert Heiko Schocher
2019-02-18  7:44   ` Eran Matityahu
2019-02-18 12:15     ` Heiko Schocher
2019-03-07  5:16 ` Heiko Schocher
2019-04-09 13:28 ` Heiko Schocher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190213185543.GA8209@ubuntu \
    --to=eran.m@variscite.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox