[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1c980fea-75c5-4e11-b769-b6d6967ed681@redhat.com>
Date: Tue, 26 Nov 2024 09:14:05 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Rahul Rameshbabu <sergeantsagara@...tonmail.com>, netdev@...r.kernel.org,
rust-for-linux@...r.kernel.org
Cc: FUJITA Tomonori <fujita.tomonori@...il.com>,
Trevor Gross <tmgross@...ch.edu>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Andrew Lunn <andrew@...n.ch>, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net] rust: net::phy scope ThisModule usage in the
module_phy_driver macro
On 11/13/24 18:45, Rahul Rameshbabu wrote:
> Similar to the use of $crate::Module, ThisModule should be referred to as
> $crate::ThisModule in the macro evaluation. The reason the macro previously
> did not cause any errors is because all the users of the macro would use
> kernel::prelude::*, bringing ThisModule into scope.
>
> Fixes: 2fe11d5ab35d ("rust: net::phy add module_phy_driver macro")
> Signed-off-by: Rahul Rameshbabu <sergeantsagara@...tonmail.com>
> ---
>
> Notes:
> How I came up with this change:
>
> I was working on my own rust bindings and rust driver when I compared my
> macro_rule to the one used for module_phy_driver. I noticed, if I made a
> driver that does not use kernel::prelude::*, that the ThisModule type
> identifier used in the macro would cause an error without being scoped in
> the macro_rule. I believe the correct implementation for the macro is one
> where the types used are correctly expanded with needed scopes.
As noted by Jakub, since this apparently does not address a problem
existing in the current tree, but cleans-up the implementation for
future usage, I suggest to target the net-next without a fixes tag.
Note that net-next is currently closed for the merge window and will
re-open around Dec 2.
Thanks,
Paolo
Powered by blists - more mailing lists