rust: add example for `alias` argument in `module` macro documentation
PATCH v2 1/2 rust: add example for `alias` argument in `module` macro documentation
Add example for alias argument supported by module macro. alias accepts an array of alternate names for the module as string.
---
Changes in v2:
- Add Reviewed-by tag
- Link to v1: https://lore.kernel.org/rust-for-linux/[email protected]/
rust/macros/lib.rs | 1 + 1 file changed, 1 insertion(+)
rust/macros/lib.rs +1 -0
@@ -35,6 +35,7 @@/// author: "Rust for Linux Contributors", /// description: "My very own kernel module!", /// license: "GPL", +/// alias: ["alternate_module_name"], /// } /// /// struct MyModule;
Signature · 1 line
2.43.0
PATCH v2 2/2 rust: fix datatype in docs for `module` macro arguments
Remove the mention of byte array as datatype for module macro arguments since the arguments are defined as string, and alias is a string array.
---
Changes in v2:
- Add expected string literal type in documentation for module macro
arguments since some module macro arguments expect ASCII string
literals.
- Link to v1: https://lore.kernel.org/rust-for-linux/[email protected]/T/#t
rust/macros/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
rust/macros/lib.rs +5 -5
@@ -58,11 +58,11 @@/// /// # Supported argument types /// - `type`: type which implements the [`Module`] trait (required). -/// - `name`: byte array of the name of the kernel module (required). -/// - `author`: byte array of the author of the kernel module. -/// - `description`: byte array of the description of the kernel module. -/// - `license`: byte array of the license of the kernel module (required). -/// - `alias`: byte array of alias name of the kernel module. +/// - `name`: ASCII string literal of the name of the kernel module (required). +/// - `author`: string literal of the author of the kernel module. +/// - `description`: string literal of the description of the kernel module. +/// - `license`: ASCII string literal of the license of the kernel module (required). +/// - `alias`: array of ASCII string literals of the alias names of the kernel module. #[proc_macro] pub fn module (ts:TokenStream ) ->TokenStream { module::module (ts)
Signature · 1 line
2.43.0
Re: [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments
Quoted 4 lines · Aswin Unnikrishnan
Remove the mention of byte array as datatype for
modulemacro arguments since the arguments are defined as string, andaliasis a string array.Signed-off-by Aswin Unnikrishnan <[email protected]>
---
Cheers,
Benno
Re: [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments
In reply to Aswin UnnikrishnanQuoted 5 lines
Remove the mention of byte array as datatype for
modulemacro arguments since the arguments are defined as string, andaliasis a string array.Signed-off-by Aswin Unnikrishnan <[email protected]>---
Quoted 5 lines · Aswin Unnikrishnan
Add example for
aliasargument supported bymodulemacro.aliasaccepts an array of alternate names for the module as string.Reviewed-by Alice Ryhl <[email protected]>Signed-off-by Aswin Unnikrishnan <[email protected]>
---
Cheers,
Benno
Miguel Ojeda
AppliedQuoted 6 lines · Aswin Unnikrishnan
Add example for
aliasargument supported bymodulemacro.aliasaccepts an array of alternate names for the module as string.Reviewed-by Alice Ryhl <[email protected]>Signed-off-by Aswin Unnikrishnan <[email protected]>
Applied series to rust-next -- thanks everyone!
Cheers,
Miguel