Commit 38559da6 authored by Guilherme Giacomo Simoes's avatar Guilherme Giacomo Simoes Committed by Miguel Ojeda
Browse files

rust: module: introduce `authors` key



In the `module!` macro, the `author` field is currently of type `String`.

Since modules can have multiple authors, this limitation prevents
specifying more than one.

Add an `authors` field as `Option<Vec<String>>` to allow creating
modules with multiple authors, and change the documentation and all
current users to use it. Eventually, the single `author` field may
be removed.

[ The `modinfo` key needs to still be `author`; otherwise, tooling
  may not work properly, e.g.:

      $ modinfo --author samples/rust/rust_print.ko
      Rust for Linux Contributors

  I have also kept the original `author` field (undocumented), so
  that we can drop it more easily in a kernel cycle or two.

    - Miguel ]

Suggested-by: default avatarMiguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/244


Reviewed-by: default avatarCharalampos Mitrodimas <charmitro@posteo.net>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarAndreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: default avatarGuilherme Giacomo Simoes <trintaeoitogc@gmail.com>
Link: https://lore.kernel.org/r/20250309175712.845622-2-trintaeoitogc@gmail.com


[ Fixed `modinfo` key. Kept `author` field. Reworded message
  accordingly. Updated my email. - Miguel ]
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent fc2f191f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
module! {
    type: NullBlkModule,
    name: "rnull_mod",
    author: "Andreas Hindborg",
    authors: ["Andreas Hindborg"],
    description: "Rust implementation of the C null block driver",
    license: "GPL v2",
}
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
        DeviceId::new_with_driver::<PhyAX88796B>()
    ],
    name: "rust_asix_phy",
    author: "FUJITA Tomonori <fujita.tomonori@gmail.com>",
    authors: ["FUJITA Tomonori <fujita.tomonori@gmail.com>"],
    description: "Rust Asix PHYs driver",
    license: "GPL",
}
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
        phy::DeviceId::new_with_driver::<PhyQT2025>(),
    ],
    name: "qt2025_phy",
    author: "FUJITA Tomonori <fujita.tomonori@gmail.com>",
    authors: ["FUJITA Tomonori <fujita.tomonori@gmail.com>"],
    description: "AMCC QT2025 PHY driver",
    license: "GPL",
    firmware: ["qt2025-2.0.3.3.fw"],
+2 −2
Original line number Diff line number Diff line
@@ -790,7 +790,7 @@ const fn as_int(&self) -> u32 {
///         DeviceId::new_with_driver::<PhySample>()
///     ],
///     name: "rust_sample_phy",
///     author: "Rust for Linux Contributors",
///     authors: ["Rust for Linux Contributors"],
///     description: "Rust sample PHYs driver",
///     license: "GPL",
/// }
@@ -819,7 +819,7 @@ const fn as_int(&self) -> u32 {
/// module! {
///     type: Module,
///     name: "rust_sample_phy",
///     author: "Rust for Linux Contributors",
///     authors: ["Rust for Linux Contributors"],
///     description: "Rust sample PHYs driver",
///     license: "GPL",
/// }
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ extern "C" fn remove_callback(pdev: *mut bindings::pci_dev) {
/// kernel::module_pci_driver! {
///     type: MyDriver,
///     name: "Module name",
///     author: "Author name",
///     authors: ["Author name"],
///     description: "Description",
///     license: "GPL v2",
/// }
Loading