Re: [RFC][PATCH 0/5] Improve static call NULL handling

From: Steven Rostedt
Date: Fri Mar 10 2023 - 16:10:02 EST


On Fri, 10 Mar 2023 12:31:12 -0800
Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:

> static_call_update(foo, STATIC_CALL_NOP); // do nothing and return 0
> static_call_update(foo, STATIC_CALL_BUG); // panic
> static_call_update(foo, NULL); // ???
>
> The default behavior for NULL could be a key-specific policy, stored as
> a flag in the static_call_key struct.

Could we just get rid of the ambiguity and make

static_call_update(foo, NULL);

trigger a WARN_ON() instead, and always do nop?

The issue I have with allowing NULL, is that it's not easy to know from the
call site what it does.

-- Steve