[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250212194717.191979-2-trintaeoitogc@gmail.com>
Date: Wed, 12 Feb 2025 16:47:15 -0300
From: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
To: a.hindborg@...nel.org,
alex.gaynor@...il.com,
aliceryhl@...gle.com,
apw@...onical.com,
arnd@...db.de,
aswinunni01@...il.com,
axboe@...nel.dk,
benno.lossin@...ton.me,
bhelgaas@...gle.com,
bjorn3_gh@...tonmail.com,
boqun.feng@...il.com,
dakr@...nel.org,
dwaipayanray1@...il.com,
ethan.twardy@...il.com,
fujita.tomonori@...il.com,
gary@...yguo.net,
gregkh@...uxfoundation.org,
joe@...ches.com,
lukas.bulwahn@...il.com,
ojeda@...nel.org,
pbonzini@...hat.com,
tmgross@...ch.edu,
walmeida@...rosoft.com
Cc: trintaeoitogc@...il.com,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Subject: [PATCH 1/3] rust: module: change author to be a array
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@...il.com>
Link: https://github.com/Rust-for-Linux/linux/issues/244
Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@...il.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
Powered by blists - more mailing lists