Thread (2 messages) flat view 2 messages, 2 authors, 2021-03-17

Re: [PATCH v2] sched: replace if (cond) BUG() with WARN_ON()

From: Arnd Bergmann <arnd@arndb.de>
Date: 2021-03-17 07:56:01
Also in: lkml

On Wed, Mar 17, 2021 at 8:35 AM Jiapeng Chong
[off-list ref] wrote:
Fix the following coccicheck warnings:

./arch/powerpc/platforms/cell/spufs/sched.c:908:2-5: WARNING: Use BUG_ON
instead of if condition followed by BUG.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
If you change it from BUG() to WARN_ON(), you should explain why it's safe to
do that in this case. Here it is not, since the following spu_release() will
end up making things worse if the acquire failed. Also if there was a signal
pending, then spusched_tick() will just get called again and constantly
print these warnings.

There is probably a way to use WARN_ON_ONCE() here, in combination
with a way to terminate the thread safely, but this has to be done carefully.

       Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help