]> Gentwo Git Trees - linux/.git/commit
tools: ynl-gen: add function prefix argument
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>
Thu, 20 Nov 2025 17:44:26 +0000 (17:44 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 Nov 2025 03:20:42 +0000 (19:20 -0800)
commit17fa6ee35bd4b78752a2d33b92614a1c230a1ced
tree2dbb9f62f60533c9eac304a1da00ccfb5d9dc3a0
parent97a88d9e2ad28ad1d5e5e8f1dc7122b4fe38d630
tools: ynl-gen: add function prefix argument

This patch adds a new CLI argument for overriding the default
function prefix, as used for naming the doit/dumpit functions
in the generated kernel code.

When not specified the default "$(FAMILY)-nl" is used.

This can also be specified persistently in generated files:
  /* YNL-ARG --function-prefix wg */

In the above example it causes the following changes:
  wireguard_nl_get_device_dumpit() -> wg_get_device_dumpit()
  wireguard_nl_get_device_doit()   -> wg_get_device_doit()

The variable name fn_prefix, was chosen as it relates to op_prefix
which is used to prefix the UAPI commands enum entries.

Link: https://lore.kernel.org/r/aRvWzC8qz3iXDAb3@zx2c4.com/
Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Link: https://patch.msgid.link/20251120174429.390574-2-ast@fiberby.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/pyynl/ynl_gen_c.py