public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert
@ 2019-02-13 18:55 Eran Matityahu
  2019-02-18  5:06 ` Heiko Schocher
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Eran Matityahu @ 2019-02-13 18:55 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert
  2019-02-13 18:55 [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert Eran Matityahu
@ 2019-02-18  5:06 ` Heiko Schocher
  2019-02-18  7:44   ` Eran Matityahu
  2019-03-07  5:16 ` Heiko Schocher
  2019-04-09 13:28 ` Heiko Schocher
  2 siblings, 1 reply; 6+ messages in thread
From: Heiko Schocher @ 2019-02-18  5:06 UTC (permalink / raw)
  To: u-boot

Hello Eran,

Am 13.02.2019 um 19:55 schrieb Eran Matityahu:
> 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(+)

Is there any reason for this change?

If I see it correct, pid is for U-Boot always set to one in
./lib/linux_compat.c ... so I see no reason for introducing here
an U-Boot specific version of ubi_assert() ...

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert
  2019-02-18  5:06 ` Heiko Schocher
@ 2019-02-18  7:44   ` Eran Matityahu
  2019-02-18 12:15     ` Heiko Schocher
  0 siblings, 1 reply; 6+ messages in thread
From: Eran Matityahu @ 2019-02-18  7:44 UTC (permalink / raw)
  To: u-boot

Hi Heiko.

On Mon, Feb 18, 2019 at 7:06 AM Heiko Schocher <hs@denx.de> wrote:
>
> Hello Eran,
>
> Am 13.02.2019 um 19:55 schrieb Eran Matityahu:
> > 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(+)
>
> Is there any reason for this change?
>
> If I see it correct, pid is for U-Boot always set to one in
> ./lib/linux_compat.c ... so I see no reason for introducing here
> an U-Boot specific version of ubi_assert() ...
>
> bye,
> Heiko
> --
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

Sure, it works with the pid print, however:
1. The pid print is useless in U-Boot.
2. I wanted to align it with ubifs_assert() and the rest of the macros in
fs/ubifs/debug.h, which also have U-Boot specific versions without the
pid print.
3. If you agree with the next patch I sent (using pr_debug), then it's
probably best to have a U-Boot specific version for ubi_assert()
anyway.

Regards,
Eran

-- 

Eran Matityahu  |  Software manager
Website |  www.variscite.com        Variscite wiki | www.variwiki.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert
  2019-02-18  7:44   ` Eran Matityahu
@ 2019-02-18 12:15     ` Heiko Schocher
  0 siblings, 0 replies; 6+ messages in thread
From: Heiko Schocher @ 2019-02-18 12:15 UTC (permalink / raw)
  To: u-boot

Hello Eran,

Am 18.02.2019 um 08:44 schrieb Eran Matityahu:
> Hi Heiko.
> 
> On Mon, Feb 18, 2019 at 7:06 AM Heiko Schocher <hs@denx.de> wrote:
>>
>> Hello Eran,
>>
>> Am 13.02.2019 um 19:55 schrieb Eran Matityahu:
>>> 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(+)
>>
>> Is there any reason for this change?
>>
>> If I see it correct, pid is for U-Boot always set to one in
>> ./lib/linux_compat.c ... so I see no reason for introducing here
>> an U-Boot specific version of ubi_assert() ...
>>
>> bye,
>> Heiko
>> --
>> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
> 
> Sure, it works with the pid print, however:
> 1. The pid print is useless in U-Boot.
> 2. I wanted to align it with ubifs_assert() and the rest of the macros in
> fs/ubifs/debug.h, which also have U-Boot specific versions without the
> pid print.
> 3. If you agree with the next patch I sent (using pr_debug), then it's
> probably best to have a U-Boot specific version for ubi_assert()
> anyway.

Ah, I see. Ok, I have no objections.

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert
  2019-02-13 18:55 [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert Eran Matityahu
  2019-02-18  5:06 ` Heiko Schocher
@ 2019-03-07  5:16 ` Heiko Schocher
  2019-04-09 13:28 ` Heiko Schocher
  2 siblings, 0 replies; 6+ messages in thread
From: Heiko Schocher @ 2019-03-07  5:16 UTC (permalink / raw)
  To: u-boot

Hello Eran,

Am 13.02.2019 um 19:55 schrieb Eran Matityahu:
> 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(+)

Reviewed-by: Heiko Schocher <hs@denx.de>

queued for next merge window.

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert
  2019-02-13 18:55 [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert Eran Matityahu
  2019-02-18  5:06 ` Heiko Schocher
  2019-03-07  5:16 ` Heiko Schocher
@ 2019-04-09 13:28 ` Heiko Schocher
  2 siblings, 0 replies; 6+ messages in thread
From: Heiko Schocher @ 2019-04-09 13:28 UTC (permalink / raw)
  To: u-boot

Hello Eran,

Am 13.02.2019 um 19:55 schrieb Eran Matityahu:
> 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(+)

Applied to uboot-ubi.git master

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-09 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-13 18:55 [U-Boot] [PATCH 1/2] mtd: ubi debug: Remove the pid print from ubi_assert Eran Matityahu
2019-02-18  5:06 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox