lkml.org 
[lkml]   [2023]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 0/5] Improve static call NULL handling
On Fri, 10 Mar 2023 12:31:12 -0800
Josh Poimboeuf <jpoimboe@kernel.org> 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

\
 
 \ /
  Last update: 2023-03-27 00:53    [W:0.149 / U:1.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site