[U-Boot] [PATCH v2 3/5] Introduce CONFIG_ENABLE_BUG_CHECKS to disable BUG{_ON} by default

Simon Glass sjg at chromium.org
Tue Dec 12 04:38:42 UTC 2017


On 3 December 2017 at 20:37, Masahiro Yamada
<yamada.masahiro at socionext.com> wrote:
> BUG() and BUG_ON() are generally used to test a condition that should
> never happen.  If it does, it is a bug.
>
> Linux always enables them, but doing so in U-Boot causes image size
> problems on some platforms.  Introduce CONFIG_ENABLE_BUG_CHECKS to
> make them no-op by default.  Platforms without image size constraint
> are free to enable this option to catch bugs easily.
>
> Likewise, silence WARN_ON() unless this option is enabled.
>
> Suggested-by: Tom Rini <trini at konsulko.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> ---
>
> Changes in v2:
>   - Newly added
>
>  include/linux/bug.h | 9 ++++++++-
>  lib/Kconfig         | 7 +++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list