[U-Boot] [PATCH v3 0/6] assert() is almost used in the same way as BUG_ON(), except:

Tom Rini trini at konsulko.com
Sun Jan 28 16:04:09 UTC 2018


On Wed, Jan 10, 2018 at 10:45:18AM +0900, Masahiro Yamada wrote:

>   - the logic is opposite
>   - currently, assert() is compiled only when DEBUG is defined
> 
> Coccinelle can easily convert assert() to BUG_ON().
> 
> A problem is it would grow the image size.
> In v2, I introduced a new CONFIG option to allow to disable it.
> 
> In v3, it is default 'y'.  I disabled it only for openrd boards.
> 
> 
> Masahiro Yamada (6):
>   Enable CONFIG_PANIC_HANG for boards without do_reset()
>   usb: xhci: return ERR_PTR(-ETIMEDOUT) at the end of
>     xhci_wait_for_event()
>   Introduce CONFIG_BUG_CHECKS to allow to disable BUG{_ON} and WARN_ON
>   ARM: openrd: disable CONFIG_BUG_CHECKS
>   treewide: convert assert() to BUG_ON()
>   Remove assert()

So, as much as I want this change in theory, I'm not sure what to do
with this series.  First, there's the USB side (and other I'm sure less
visible cases) where this does change behavior a bit.  But second, and
harder to deal with, is that this totally breaks all of our test/py code
(make tests hangs) and I haven't come up with a good fix.  I think some
of these changes can certainly be brought in.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180128/fc23c871/attachment.sig>


More information about the U-Boot mailing list