rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation
@ 2024-05-12 11:23 Aswin Unnikrishnan
  2024-05-12 11:23 ` [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments Aswin Unnikrishnan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Aswin Unnikrishnan @ 2024-05-12 11:23 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, rust-for-linux, Aswin Unnikrishnan

Add example for `alias` argument supported by `module` macro.
`alias` accepts an array of alternate names for the module as string.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Aswin Unnikrishnan <aswinunni01@gmail.com>
---

Changes in v2:
- Add Reviewed-by tag
- Link to v1: https://lore.kernel.org/rust-for-linux/20240419215015.157258-2-aswinunni01@gmail.com/

 rust/macros/lib.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
index 520eae5fd792..aa89b41fa10e 100644
--- a/rust/macros/lib.rs
+++ b/rust/macros/lib.rs
@@ -35,6 +35,7 @@
 ///     author: "Rust for Linux Contributors",
 ///     description: "My very own kernel module!",
 ///     license: "GPL",
+///     alias: ["alternate_module_name"],
 /// }
 ///
 /// struct MyModule;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments
  2024-05-12 11:23 [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation Aswin Unnikrishnan
@ 2024-05-12 11:23 ` Aswin Unnikrishnan
  2024-05-27 19:31   ` Benno Lossin
  2024-05-29 18:55   ` Vincenzo Palazzo
  2024-05-27 19:31 ` [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation Benno Lossin
  2024-07-09  7:32 ` Miguel Ojeda
  2 siblings, 2 replies; 6+ messages in thread
From: Aswin Unnikrishnan @ 2024-05-12 11:23 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, rust-for-linux, Aswin Unnikrishnan

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.

Signed-off-by: Aswin Unnikrishnan <aswinunni01@gmail.com>
---

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/20240419215015.157258-3-aswinunni01@gmail.com/T/#t

 rust/macros/lib.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
index aa89b41fa10e..5214e07367c5 100644
--- a/rust/macros/lib.rs
+++ b/rust/macros/lib.rs
@@ -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)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation
  2024-05-12 11:23 [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation Aswin Unnikrishnan
  2024-05-12 11:23 ` [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments Aswin Unnikrishnan
@ 2024-05-27 19:31 ` Benno Lossin
  2024-07-09  7:32 ` Miguel Ojeda
  2 siblings, 0 replies; 6+ messages in thread
From: Benno Lossin @ 2024-05-27 19:31 UTC (permalink / raw)
  To: Aswin Unnikrishnan, Miguel Ojeda, Alex Gaynor,
	Wedson Almeida Filho
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Andreas Hindborg,
	Alice Ryhl, rust-for-linux

On 12.05.24 13:23, Aswin Unnikrishnan wrote:
> Add example for `alias` argument supported by `module` macro.
> `alias` accepts an array of alternate names for the module as string.
> 
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Aswin Unnikrishnan <aswinunni01@gmail.com>

Reviewed-by: Benno Lossin <benno.lossin@proton.me>

---
Cheers,
Benno


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments
  2024-05-12 11:23 ` [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments Aswin Unnikrishnan
@ 2024-05-27 19:31   ` Benno Lossin
  2024-05-29 18:55   ` Vincenzo Palazzo
  1 sibling, 0 replies; 6+ messages in thread
From: Benno Lossin @ 2024-05-27 19:31 UTC (permalink / raw)
  To: Aswin Unnikrishnan, Miguel Ojeda, Alex Gaynor,
	Wedson Almeida Filho
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Andreas Hindborg,
	Alice Ryhl, rust-for-linux

On 12.05.24 13:23, Aswin Unnikrishnan wrote:
> 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.
> 
> Signed-off-by: Aswin Unnikrishnan <aswinunni01@gmail.com>

Reviewed-by: Benno Lossin <benno.lossin@proton.me>

---
Cheers,
Benno


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments
  2024-05-12 11:23 ` [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments Aswin Unnikrishnan
  2024-05-27 19:31   ` Benno Lossin
@ 2024-05-29 18:55   ` Vincenzo Palazzo
  1 sibling, 0 replies; 6+ messages in thread
From: Vincenzo Palazzo @ 2024-05-29 18:55 UTC (permalink / raw)
  To: Aswin Unnikrishnan
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, rust-for-linux

> 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.
>
> Signed-off-by: Aswin Unnikrishnan <aswinunni01@gmail.com>
> ---
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation
  2024-05-12 11:23 [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation Aswin Unnikrishnan
  2024-05-12 11:23 ` [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments Aswin Unnikrishnan
  2024-05-27 19:31 ` [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation Benno Lossin
@ 2024-07-09  7:32 ` Miguel Ojeda
  2 siblings, 0 replies; 6+ messages in thread
From: Miguel Ojeda @ 2024-07-09  7:32 UTC (permalink / raw)
  To: Aswin Unnikrishnan
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, rust-for-linux

On Sun, May 12, 2024 at 1:23 PM Aswin Unnikrishnan
<aswinunni01@gmail.com> wrote:
>
> Add example for `alias` argument supported by `module` macro.
> `alias` accepts an array of alternate names for the module as string.
>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Aswin Unnikrishnan <aswinunni01@gmail.com>

Applied series to `rust-next` -- thanks everyone!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-09  7:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-12 11:23 [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation Aswin Unnikrishnan
2024-05-12 11:23 ` [PATCH v2 2/2] rust: fix datatype in docs for `module` macro arguments Aswin Unnikrishnan
2024-05-27 19:31   ` Benno Lossin
2024-05-29 18:55   ` Vincenzo Palazzo
2024-05-27 19:31 ` [PATCH v2 1/2] rust: add example for `alias` argument in `module` macro documentation Benno Lossin
2024-07-09  7:32 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).