Re: [PATCH] [PATCH] rust: macros: add authors

Miguel Ojeda
2024-12-06T20:17:59Z

On Fri, Dec 6, 2024 at 8:22 PM guilherme giacomo simoes
<trintaeoitogc@gmail.com> wrote:
>
> The module is only accepted to have a single author. If the module needs
> more than one author, you cannot define this in the module creating
> flow.
> Add another key in the module stream that accepts a string array with
> authors.
> Author and authors keys cannot coexist, so add a check that if the
> module authors addss these two keys, throw a panic!

Thanks for the patch!

There are several ways we could do this:

- A single field, that only accepts a list.

- A single field that accepts both a string or a list.

- Two fields like this (that cannot coexist).

- Accepting several "author" fields and append them all into a list.

Any thoughts on what is best? Could you please describe why you picked
the one you picked? (Ideally in the commit message). For instance, the
first one is e.g. what Cargo does and is the simplest, though slightly
annoying in the most common case of a single author. I wouldn't mind
it though, since this is likely copy-pasted from file to file anyway.

In addition, there was a PR [1] by Wayne (Cc'd) that implemented the
first approach, but it was never sent to the list. I pinged in the
GitHub issue too.

[1] https://github.com/Rust-for-Linux/linux/pull/904

> Signed-off-by: guilherme giacomo simoes <trintaeoitogc@gmail.com>

Ideally add (before the Signed-off-by) a Link: and Suggested-by: tag.

> - for alias in aliases {
> - modinfo.emit("alias", &alias);
> - }
> + modinfo.emit_arr_str("alias", &aliases);

Spurious change? Or am I missing something?

Also, this patch should update the documentation of the macro.

Finally, the title has an extra "[PATCH]" prefix.

Cheers,
Miguel