All of lore.kernel.org
 help / color / mirror / Atom feed
* The future of ubi_assert()
@ 2014-11-05 22:02 Richard Weinberger
  2014-11-06  7:21 ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2014-11-05 22:02 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org, Artem Bityutskiy

Artem,

I'm not happy with ubi_assert().
Currently it only prints a warning and a stack trace but execution
continues. In production nobody will notice and while developing turning
it into a plain BUG_ON is most of the time more useful because execution stops
exactly where the boo boo happens one can analyze stack/registers.

I propose splitting ubi_assert() into two new functions.

1. ubi_bug_on()
Basically a BUG_ON(), it shall be used for assertions where execution of
UBI cannot proceed and anything we can do is crashing the machine.

2. ubi_warn_on()
This macro shall be used for assertions where further execution is possible
in read-only mode. ubi_warn_on() would be a WARN_ON() plus ubi_ro_mode().

I'm sure that the vast majority of all ubi_asserts() can be turned into a ubi_warn_on().

What do you think?

Thanks,
//richard

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

end of thread, other threads:[~2014-11-06  8:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 22:02 The future of ubi_assert() Richard Weinberger
2014-11-06  7:21 ` Artem Bityutskiy
2014-11-06  8:07   ` Richard Weinberger
2014-11-06  8:13     ` Artem Bityutskiy
2014-11-06  8:16       ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.