On 17.10.2022 10:43, Henry Wang wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeul...@suse.com>
>>> I added the doc asked in your previous email. Also, I will use a
>>>
>>> ASSERT(p2m_teardown(d, false) == 0);
>>>
>>> in p2m_final_teardown() here.
>>
>> Hopefully this was meant only as an abstract plan, not the exact code
>> you mean to add? ASSERT() expressions generally should not have side
>> effects (which includes function calls).
> 
> Yeah, when I wrote the v3 code I noticed that ASSERT might be limited
> to the CONFIG_DEBUG so in the v3 I switched to BUG_ON which IIUC
> can make sure the function call is valid all the time.

But in the past we still recommended against doing so even with BUG_ON().
More recently Andrew (iirc) has voiced an opinion in the opposite
direction, but I'm not aware of us actually having changed direction in
this regard. Apart from that ASSERT() and BUG_ON() aren't meant to be
freely interchanged - the the respective part of ./CODFING_STYLE.

Jan

Reply via email to