Re: [PATCH v1 3/3] rust: net::phy Change module_phy_driver macro to use module_device_table macro
From: Miguel Ojeda
Date: Mon Jun 23 2025 - 05:22:37 EST
On Mon, Jun 23, 2025 at 8:10 AM FUJITA Tomonori
<fujita.tomonori@xxxxxxxxx> wrote:
>
> +// SAFETY: [`DeviceId`] is a `#[repr(transparent)` wrapper of `struct mdio_device_id`
No need for intra-doc link in normal comments.
Also, missing bracket (which apparently comes from another comment, so
probably copy-pasted).
> + // This should never be called.
> + fn index(&self) -> usize {
> + 0
> + }
Hmm... This isn't great. Could this perhaps be designed differently?
e.g. split into two traits, possibly based one on another, or similar?
Worst case, we should at least do a `debug_assert!` or similar.
Cheers,
Miguel