rust: module: remove deprecated author key
Subsystems (10)
PATCH 1/1 rust: module: remove deprecated author key
Commit 38559da6afb2 ("rust: module: introduce authors key") introduced a new authors key to support multiple module authors, while keeping the old author key for backward compatibility.
Now that all in-tree modules have migrated to authors, remove:
1. The deprecated author key support from the module macro
2. Legacy author entries from remaining modules
--- drivers/cpufreq/rcpufreq_dt.rs | 2 +- drivers/gpu/drm/nova/nova.rs | 2 +- drivers/gpu/nova-core/nova_core.rs | 2 +- rust/kernel/firmware.rs | 2 +- rust/macros/module.rs | 6 ------ samples/rust/rust_configfs.rs | 2 +- samples/rust/rust_driver_auxiliary.rs | 2 +- 7 files changed, 6 insertions(+), 12 deletions(-)
drivers/cpufreq/rcpufreq_dt.rs +1 -1
@@ -220,7 +220,7 @@ fn probe(module_platform_driver! {type :CPUFreqDTDriver , name:"cpufreq-dt" , - author:"Viresh Kumar <[email protected]>" , + authors: ["Viresh Kumar <[email protected]>" ], description:"Generic CPUFreq DT driver" , license:"GPL v2" , }
drivers/gpu/drm/nova/nova.rs +1 -1
@@ -12,7 +12,7 @@ kernel::module_auxiliary_driver! {type :NovaDriver , name:"Nova" , - author:"Danilo Krummrich" , + authors: ["Danilo Krummrich" ], description:"Nova GPU driver" , license:"GPL v2" , }
drivers/gpu/nova-core/nova_core.rs +1 -1
@@ -13,7 +13,7 @@ kernel::module_pci_driver! {type : driver::NovaCore , name:"NovaCore" , - author:"Danilo Krummrich" , + authors: ["Danilo Krummrich" ], description:"Nova Core GPU driver" , license:"GPL v2" , firmware: [],
rust/kernel/firmware.rs +1 -1
@@ -181,7 +181,7 @@ unsafe impl Sync for Firmware {}/// module! { /// type: MyModule, /// name: "module_firmware_test", -/// author: "Rust for Linux", +/// authors: ["Rust for Linux"], /// description: "module_firmware! test module", /// license: "GPL", /// }
rust/macros/module.rs +0 -6
@@ -94,7 +94,6 @@ struct ModuleInfo { type_: String, license: String, name: String, - author: Option<String>, authors: Option<Vec<String>>, description: Option<String>, alias: Option<Vec<String>>,
@@ -108,7 +107,6 @@ fn parse(it: &mut token_stream::IntoIter) -> Self {const EXPECTED_KEYS : &[&str ] = &["type" ,"name" , -"author" ,"authors" ,"description" , "license",
@@ -134,7 +132,6 @@ 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)),"authors" => info.authors =Some (expect_string_array (it)),"description" => info.description =Some (expect_string (it)),"license" => info.license =expect_string_ascii (it),
@@ -179,9 +176,6 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {// Rust does not allow hyphens in identifiers, use underscore instead. let ident = info.name.replace ('-' ,"_" );let mut modinfo =ModInfoBuilder ::new (ident.as_ref ()); -if let Some (author) = info.author { - modinfo.emit ("author" , &author); - }if let Some (authors) = info.authors {for authorin authors { modinfo.emit ("author" , &author);
samples/rust/rust_configfs.rs +1 -1
@@ -14,7 +14,7 @@module! {type :RustConfigfs , name:"rust_configfs" , - author:"Rust for Linux Contributors" , + authors: ["Rust for Linux Contributors" ], description:"Rust configfs sample" , license:"GPL" , }
samples/rust/rust_driver_auxiliary.rs +1 -1
@@ -114,7 +114,7 @@ fn init(module: &'static kernel::ThisModule) -> impl PinInit<Self, Error> {module! {type :SampleModule , name:"rust_driver_auxiliary" , - author:"Danilo Krummrich" , + authors: ["Danilo Krummrich" ], description:"Rust auxiliary driver" , license:"GPL v2" , }
Signature · 1 line
2.34.1
Quoted 2 lines · Guilherme Giacomo Simoes
Now that all in-tree modules have migrated to
authors, remove:
Nit: I would have said "most modules", since we have new/remaining ones (no need for a new version for this).
I think this patch is OK -- we could wait to do this more cycles, but if we are doing it, then probably the sooner we do it, the simpler.
Quoted 6 lines
drivers/cpufreq/rcpufreq_dt.rs | 2 +- drivers/gpu/drm/nova/nova.rs | 2 +- drivers/gpu/nova-core/nova_core.rs | 2 +- rust/kernel/firmware.rs | 2 +- samples/rust/rust_configfs.rs | 2 +- samples/rust/rust_driver_auxiliary.rs | 2 +-
Andreas, Danilo, Greg, Viresh: if nobody is against it, I will apply it this cycle. Acked-by's for your bits appreciated, of course.
Thanks!
Cheers,
Miguel
Quoted 18 lines · Miguel Ojeda
Quoted 2 lines · Guilherme Giacomo Simoes
Now that all in-tree modules have migrated to
authors, remove:Nit: I would have said "most modules", since we have new/remaining ones (no need for a new version for this).
I think this patch is OK -- we could wait to do this more cycles, but if we are doing it, then probably the sooner we do it, the simpler.
Quoted 6 lines
drivers/cpufreq/rcpufreq_dt.rs | 2 +- drivers/gpu/drm/nova/nova.rs | 2 +- drivers/gpu/nova-core/nova_core.rs | 2 +- rust/kernel/firmware.rs | 2 +- samples/rust/rust_configfs.rs | 2 +- samples/rust/rust_driver_auxiliary.rs | 2 +-
Quoted 2 lines
Andreas, Danilo, Greg, Viresh: if nobody is against it, I will apply it this cycle. Acked-by's for your bits appreciated, of course.
Quoted 19 lines · Danilo Krummrich
Quoted 18 lines · Miguel Ojeda
Quoted 2 lines · Guilherme Giacomo Simoes
Now that all in-tree modules have migrated to
authors, remove:Nit: I would have said "most modules", since we have new/remaining ones (no need for a new version for this).
I think this patch is OK -- we could wait to do this more cycles, but if we are doing it, then probably the sooner we do it, the simpler.
Quoted 6 lines
drivers/cpufreq/rcpufreq_dt.rs | 2 +- drivers/gpu/drm/nova/nova.rs | 2 +- drivers/gpu/nova-core/nova_core.rs | 2 +- rust/kernel/firmware.rs | 2 +- samples/rust/rust_configfs.rs | 2 +- samples/rust/rust_driver_auxiliary.rs | 2 +-
Quoted 4 lines
Quoted 2 lines
Andreas, Danilo, Greg, Viresh: if nobody is against it, I will apply it this cycle. Acked-by's for your bits appreciated, of course.
Acked-by Danilo Krummrich <[email protected]>
Quoted 17 lines · Guilherme Giacomo Simoes
Commit
38559da6afb2("rust: module: introduceauthorskey") introduced a newauthorskey to support multiple module authors, while keeping the oldauthorkey for backward compatibility.Now that all in-tree modules have migrated to
authors, remove:
1. The deprecatedauthorkey support from the module macro
2. Legacyauthorentries from remaining modulesSigned-off-by Guilherme Giacomo Simoes <[email protected]>--- drivers/cpufreq/rcpufreq_dt.rs | 2 +-drivers/cpufreq/rcpufreq_dt.rs +0
-0
drivers/cpufreq/rcpufreq_dt.rs fn probe( · line 226
Quoted 8 lines
drivers/cpufreq/rcpufreq_dt.rs +1
-1@@ -220,7 +220,7 @@ fn probe(module_platform_driver! {type :CPUFreqDTDriver , name:"cpufreq-dt" , - author:"Viresh Kumar <[email protected]>" , + authors: ["Viresh Kumar <[email protected]>" ], description:"Generic CPUFreq DT driver" , license:"GPL v2" , }
Signature · 1 line
viresh
Quoted 9 lines · Guilherme Giacomo Simoes
Commit
38559da6afb2("rust: module: introduceauthorskey") introduced a newauthorskey to support multiple module authors, while keeping the oldauthorkey for backward compatibility.Now that all in-tree modules have migrated to
authors, remove:
1. The deprecatedauthorkey support from the module macro
2. Legacyauthorentries from remaining modulesSigned-off-by Guilherme Giacomo Simoes <[email protected]>
Best regards,
Andreas Hindborg
Quoted 9 lines · Guilherme Giacomo Simoes
Commit
38559da6afb2("rust: module: introduceauthorskey") introduced a newauthorskey to support multiple module authors, while keeping the oldauthorkey for backward compatibility.Now that all in-tree modules have migrated to
authors, remove:
1. The deprecatedauthorkey support from the module macro
2. Legacyauthorentries from remaining modulesSigned-off-by Guilherme Giacomo Simoes <[email protected]>
Quoted 9 lines
--- drivers/cpufreq/rcpufreq_dt.rs | 2 +- drivers/gpu/drm/nova/nova.rs | 2 +- drivers/gpu/nova-core/nova_core.rs | 2 +- rust/kernel/firmware.rs | 2 +- rust/macros/module.rs | 6 ------ samples/rust/rust_configfs.rs | 2 +- samples/rust/rust_driver_auxiliary.rs | 2 +- 7 files changed, 6 insertions(+), 12 deletions(-)
---
Cheers,
Benno
Benno Lossin
reviewerdrivers/gpu/nova-core/nova_core.rs line 16
Quoted 10 lines · Guilherme Giacomo Simoes
drivers/gpu/nova-core/nova_core.rs +1
-1@@ -13,7 +13,7 @@ kernel::module_pci_driver! {type : driver::NovaCore , name:"NovaCore" , - author:"Danilo Krummrich" , + authors: ["Danilo Krummrich" ],
Unrelated to this change, I think we should add email addresses to people in authors. Possibly enforce it by scanning each author element and checking if there is an email address.
rust/kernel/firmware.rs unsafe impl Sync for Firmware {} · line 184
Quoted 13 lines
drivers/gpu/nova-core/nova_core.rs +0
-0description: "Nova Core GPU driver", license: "GPL v2", firmware: [],rust/kernel/firmware.rs +1
-1@@ -181,7 +181,7 @@ unsafe impl Sync for Firmware {}/// module! { /// type: MyModule, /// name: "module_firmware_test", -/// author: "Rust for Linux", +/// authors: ["Rust for Linux"],
We would need to special case "Rust for Linux Developers" or something similar. But in several cases -- such as this one, we should just name the actual authors.
What do you guys think?
---
Cheers,
Benno
Quoted 4 lines · Benno Lossin
Unrelated to this change, I think we should add email addresses to people in authors. Possibly enforce it by scanning each author element and checking if there is an email address.
Sounds good to me, but I am not sure if it is possible in all cases.
At least looking at C, there are company names too.
I even saw a URL...
Cheers,
Miguel
Quoted 2 lines · Miguel Ojeda
I even saw a URL...
i.e. as the sole thing, not as an addition to a company name:
MODULE_AUTHOR("https://www.comedi.org");Perhaps we could have a new key or similar for companies/entities, but I am not sure if it is important, and we should probably do it in the C side too in that case.
After all, we can get contact details from the Git log, MAINTAINERS, etc.
Cheers,
Miguel
Benno Lossin
reviewerQuoted 11 lines · Miguel Ojeda
Quoted 4 lines · Benno Lossin
Unrelated to this change, I think we should add email addresses to people in authors. Possibly enforce it by scanning each author element and checking if there is an email address.
Sounds good to me, but I am not sure if it is possible in all cases.
At least looking at C, there are company names too.
I even saw a URL...
Hmm, I guess a checkpatch lint fits better then?
---
Cheers,
Benno
Quoted 2 lines · Benno Lossin
Hmm, I guess a checkpatch lint fits better then?
Yeah, that would work.
Probably for the C side too -- from a quick grep I don't see it.
Cheers,
Miguel
Miguel Ojeda <[email protected]> wrotes:
Quoted 7 lines · Benno Lossin
Quoted 2 lines
Hmm, I guess a checkpatch lint fits better then?
Yeah, that would work.
Probably for the C side too -- from a quick grep I don't see it.
Maybe, after this patch we can make a checkpatch change for check the authors key (and MODULE_AUTHOR for C side), and throw a WARN if the author is a name (not a url, or "rust for linux") and don't have a email address.
Unless you guys tell me otherwise, I guess this is not so priority.
Thanks,
Guilherme
Quoted 6 lines · Guilherme Giacomo Simoes
Maybe, after this patch we can make a checkpatch change for check the
authorskey (andMODULE_AUTHORfor C side), and throw a WARN if the author is a name (not a url, or "rust for linux") and don't have a email address.Unless you guys tell me otherwise, I guess this is not so priority.
It is not a priority, and even if it were, it would be an independent change, i.e. not for this patch series, so no worries :)
Cheers,
Miguel
Benno Lossin
reviewerQuoted 11 lines · Guilherme Giacomo Simoes
Miguel Ojeda <[email protected]> wrotes:
Quoted 7 lines · Benno Lossin
Quoted 2 lines
Hmm, I guess a checkpatch lint fits better then?
Yeah, that would work.
Probably for the C side too -- from a quick grep I don't see it.
Maybe, after this patch we can make a checkpatch change for check the
authorskey (andMODULE_AUTHORfor C side), and throw a WARN if the author is a name (not a url, or "rust for linux") and don't have a email address.
Most other authors fields that don't list explicit names use "Rust for Linux Contributors", so we should probably scan for that instead.
But I think that we should no longer add any author fields using that. Things with that are from way back in the day (when RfL was still out of tree) where many people contributed to a single file, hence the use of that phrase.
Quoted 1 line
Unless you guys tell me otherwise, I guess this is not so priority.
Yeah this isn't high priority. We can just make this into a good-first-issue, then someone can eventually pick it up.
---
Cheers,
Benno
Miguel Ojeda
AppliedQuoted 10 lines · Guilherme Giacomo Simoes
Commit
38559da6afb2("rust: module: introduceauthorskey") introduced a newauthorskey to support multiple module authors, while keeping the oldauthorkey for backward compatibility.Now that all in-tree modules have migrated to
authors, remove:
1. The deprecatedauthorkey support from the module macro
2. Legacyauthorentries from remaining modulesSigned-off-by Guilherme Giacomo Simoes <[email protected]>
Applied to rust-next -- thanks everyone!
[ Reworded slightly. - Miguel ]
I don't see any new/missing ones in -next, so this should be clean. Let's see...
Cheers,
Miguel