lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] module: Clarify documentation of module_param_call()
On Tue, Sep 5, 2023 at 9:13 PM Kees Cook <keescook@chromium.org> wrote:
>
> Commit 9bbb9e5a3310 ("param: use ops in struct kernel_param, rather than
> get and set fns directly") added the comment that module_param_call()
> was deprecated, during a large scale refactoring to bring sanity to type
> casting back then. In 2017 following more cleanups, it became useful
> against as it wraps a common pattern of creating an ops struct for a

s/against/again/

> Many users of module_param_cb() appear to be almost universally
> open-coding the same thing that module_param_call() does now. Don't
> discourage[1] people from using module_param_call() but clarifying the
> comment: module_param_cb() is useful if you repeatedly use the same pair
> of get/set functions.

s/clarifying/clarify/

I sampled some, and indeed many define the ops struct.

> [1] https://lore.kernel.org/lkml/202308301546.5C789E5EC@keescook/

Link: tag here? It is actually quite nicely explained there.

> -/* Obsolete - use module_param_cb() */
> +/* For repeated _set & _get usage use module_param_cb() */

Perhaps add "instead"? Or perhaps add a bit more detail, something like:

Useful for describing a set/get pair used only once (i.e. for this
parameter). For repeated set/get pairs (i.e. the same kernel_param_ops
struct), use module_param_cb() instead.

Reviewed-by: Miguel Ojeda <ojeda@kernel.org>

Cheers,
Miguel

\
 
 \ /
  Last update: 2023-09-05 21:37    [W:0.036 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site