Re: [PATCH] params: Add support for static keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Le 10/05/2025 à 23:01, Kent Overstreet a écrit :
Static keys can now be a module parameter, e.g.

module_param_named(foo, foo.key, static_key_t, 0644)

bcachefs is now using this.

Cc: Luis Chamberlain <mcgrof@xxxxxxxxxx>
Cc: Petr Pavlu <petr.pavlu@xxxxxxxx>
Cc: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
Cc: Daniel Gomez <da.gomez@xxxxxxxxxxx>
Cc: linux-modules@xxxxxxxxxxxxxxx
Signed-off-by: Kent Overstreet <kent.overstreet@xxxxxxxxx>
---
  include/linux/jump_label.h  |  2 ++
  include/linux/moduleparam.h |  6 ++++++
  kernel/params.c             | 35 +++++++++++++++++++++++++++++++++++
  3 files changed, 43 insertions(+)

diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index fdb79dd1ebd8..0fc9b71db56f 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -107,6 +107,8 @@ struct static_key {
  #endif	/* CONFIG_JUMP_LABEL */
  };
+typedef struct static_key static_key_t;
+

Please read https://docs.kernel.org/process/coding-style.html#typedefs

I can't see the reason for a new typedef here. If there is a valid reason please explain in the commit message.

Christophe




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux