* [PATCH 1/3] rust: module: change author to be a array
2025-02-12 19:47 [PATCH 0/3] author field in module! macro should be a array Guilherme Giacomo Simoes
@ 2025-02-12 19:47 ` Guilherme Giacomo Simoes
2025-02-13 12:47 ` [PATCH 0/3] author field in module! macro should " Miguel Ojeda
1 sibling, 0 replies; 4+ messages in thread
From: Guilherme Giacomo Simoes @ 2025-02-12 19:47 UTC (permalink / raw)
To: a.hindborg, alex.gaynor, aliceryhl, apw, arnd, aswinunni01, axboe,
benno.lossin, bhelgaas, bjorn3_gh, boqun.feng, dakr,
dwaipayanray1, ethan.twardy, fujita.tomonori, gary, gregkh, joe,
lukas.bulwahn, ojeda, pbonzini, tmgross, walmeida
Cc: trintaeoitogc, rust-for-linux, linux-kernel, Miguel Ojeda
In the module! macro, the author field has a string type. Once that the
modules can has more than one author, this is impossible in the current
scenary.
Change the author field for accept a array string type and enable module
creations with more than one author.
Suggested-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Link: https://github.com/Rust-for-Linux/linux/issues/244
Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
---
rust/macros/module.rs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index cdf94f4982df..09265d18b44d 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
@@ -94,7 +94,7 @@ struct ModuleInfo {
type_: String,
license: String,
name: String,
- author: Option<String>,
+ author: Option<Vec<String>>,
description: Option<String>,
alias: Option<Vec<String>>,
firmware: Option<Vec<String>>,
@@ -135,7 +135,7 @@ fn parse(it: &mut token_stream::IntoIter) -> Self {
match key.as_str() {
"type" => info.type_ = expect_ident(it),
"name" => info.name = expect_string_ascii(it),
- "author" => info.author = Some(expect_string(it)),
+ "author" => info.author = Some(expect_string_array(it)),
"description" => info.description = Some(expect_string(it)),
"license" => info.license = expect_string_ascii(it),
"alias" => info.alias = Some(expect_string_array(it)),
@@ -184,7 +184,9 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
let mut modinfo = ModInfoBuilder::new(info.name.as_ref());
if let Some(author) = info.author {
- modinfo.emit("author", &author);
+ for author in author {
+ modinfo.emit("author", &author);
+ }
}
if let Some(description) = info.description {
modinfo.emit("description", &description);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 0/3] author field in module! macro should be a array
2025-02-12 19:47 [PATCH 0/3] author field in module! macro should be a array Guilherme Giacomo Simoes
2025-02-12 19:47 ` [PATCH 1/3] rust: module: change author to " Guilherme Giacomo Simoes
@ 2025-02-13 12:47 ` Miguel Ojeda
2025-02-13 17:53 ` Guilherme Giacomo Simoes
1 sibling, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2025-02-13 12:47 UTC (permalink / raw)
To: Guilherme Giacomo Simoes
Cc: a.hindborg, alex.gaynor, aliceryhl, apw, arnd, aswinunni01, axboe,
benno.lossin, bhelgaas, bjorn3_gh, boqun.feng, dakr,
dwaipayanray1, ethan.twardy, fujita.tomonori, gary, gregkh, joe,
lukas.bulwahn, ojeda, pbonzini, tmgross, walmeida, rust-for-linux,
linux-kernel
On Wed, Feb 12, 2025 at 8:47 PM Guilherme Giacomo Simoes
<trintaeoitogc@gmail.com> wrote:
>
> In the module! macro, the author field has a string type. Once that the
> modules can has more than one author, this is impossible in the current
> scenary.
I think this was a re-send -- in general, please change the title
(e.g. increase the version number or at least add "[ PATCH RESEND" or
similar) if you need to do a re-send, because otherwise it is hard to
follow which is which (e.g. in Lore).
Also, for some reason, Lore has your #2 and #3 patch in another thread
-- please try to see if you can fix that when you send the next
version. Both `git send-email` and `b4` should do the right thing by
default when sending a series.
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread