rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "FUJITA Tomonori" <fujita.tomonori@gmail.com>, <netdev@vger.kernel.org>
Cc: <rust-for-linux@vger.kernel.org>, <andrew@lunn.ch>,
	<tmgross@umich.edu>, <miguel.ojeda.sandonis@gmail.com>,
	<benno.lossin@proton.me>, <wedsonaf@gmail.com>,
	<aliceryhl@google.com>, <boqun.feng@gmail.com>
Subject: Re: [PATCH net-next v9 2/4] rust: net::phy add module_phy_driver macro
Date: Tue, 05 Dec 2023 03:48:32 +0200	[thread overview]
Message-ID: <CXG0T2MKC8H4.2WAVL6YCX9XC7@kernel.org> (raw)
In-Reply-To: <20231205011420.1246000-3-fujita.tomonori@gmail.com>

On Tue Dec 5, 2023 at 3:14 AM EET, FUJITA Tomonori wrote:
> This macro creates an array of kernel's `struct phy_driver` and
> registers it. This also corresponds to the kernel's
> `MODULE_DEVICE_TABLE` macro, which embeds the information for module
> loading into the module binary file.
>
> A PHY driver should use this macro.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> ---
>  rust/kernel/net/phy.rs | 146 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 146 insertions(+)
>
> diff --git a/rust/kernel/net/phy.rs b/rust/kernel/net/phy.rs
> index 5d220187eec9..d9cec139324a 100644
> --- a/rust/kernel/net/phy.rs
> +++ b/rust/kernel/net/phy.rs
> @@ -752,3 +752,149 @@ const fn as_int(&self) -> u32 {
>          }
>      }
>  }
> +
> +/// Declares a kernel module for PHYs drivers.
> +///
> +/// This creates a static array of kernel's `struct phy_driver` and registers it.

s/This creates a static array/Creates a static array/

Suggestion for better formulation:

"Creates a static array of `struct phy driver` instances, and registers them.""

> +/// This also corresponds to the kernel's `MODULE_DEVICE_TABLE` macro, which embeds the information
> +/// for module loading into the module binary file. Every driver needs an entry in `device_table`.

s/This/`kernel::module_phy_driver`/

Or at least I did not see it introduced earlier in the text.

BR, Jarkko

  reply	other threads:[~2023-12-05  1:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05  1:14 [PATCH net-next v9 0/4] Rust abstractions for network PHY drivers FUJITA Tomonori
2023-12-05  1:14 ` [PATCH net-next v9 1/4] rust: core " FUJITA Tomonori
2023-12-05  1:43   ` Jarkko Sakkinen
2023-12-05  2:06     ` FUJITA Tomonori
2023-12-05  2:00   ` Boqun Feng
2023-12-05  3:23     ` FUJITA Tomonori
2023-12-05  3:40       ` Boqun Feng
2023-12-07 17:25   ` Benno Lossin
2023-12-08  1:28     ` FUJITA Tomonori
2023-12-05  1:14 ` [PATCH net-next v9 2/4] rust: net::phy add module_phy_driver macro FUJITA Tomonori
2023-12-05  1:48   ` Jarkko Sakkinen [this message]
2023-12-05  3:44     ` FUJITA Tomonori
2023-12-08 14:42       ` Miguel Ojeda
2023-12-08 18:11   ` Benno Lossin
2023-12-05  1:14 ` [PATCH net-next v9 3/4] MAINTAINERS: add Rust PHY abstractions for ETHERNET PHY LIBRARY FUJITA Tomonori
2023-12-05  1:49   ` Jarkko Sakkinen
2023-12-05  1:53     ` Trevor Gross
2023-12-05  1:57       ` Jarkko Sakkinen
2023-12-05  1:53   ` Trevor Gross
2023-12-05  3:45     ` FUJITA Tomonori
2023-12-05  1:14 ` [PATCH net-next v9 4/4] net: phy: add Rust Asix PHY driver FUJITA Tomonori
2023-12-05  1:54   ` Jarkko Sakkinen
2023-12-05  2:24     ` Andrew Lunn
2023-12-05  1:35 ` [PATCH net-next v9 0/4] Rust abstractions for network PHY drivers Jarkko Sakkinen
2023-12-05  1:42   ` FUJITA Tomonori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CXG0T2MKC8H4.2WAVL6YCX9XC7@kernel.org \
    --to=jarkko@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=andrew@lunn.ch \
    --cc=benno.lossin@proton.me \
    --cc=boqun.feng@gmail.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=wedsonaf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).