Re: [PATCH v16 12/17] rust: sync: lock/global: Rename B to G in trait bounds
From: Boqun Feng
Date: Wed Dec 17 2025 - 15:34:14 EST
On Tue, Dec 16, 2025 at 05:15:18PM +0100, Dirk Behme wrote:
> On 15.12.25 18:57, Lyude Paul wrote:
> > Due to the introduction of Backend::BackendInContext, if we want to be able
> > support Lock types with a Context we need to be able to handle the fact
> > that the Backend for a returned Guard may not exactly match the Backend for
> > the lock. Before we add this though, rename B to G in all of our trait
> > bounds to make sure things don't become more difficult to understand once
> > we add a Backend bound.
> >
> > There should be no functional changes in this patch.
> >
> > Signed-off-by: Lyude Paul <lyude@xxxxxxxxxx>
> > ---
> > rust/kernel/sync/atomic.rs | 2 +-
> > rust/kernel/sync/lock/global.rs | 58 ++++++++++++++++-----------------
> > 2 files changed, 30 insertions(+), 30 deletions(-)
> >
> > diff --git a/rust/kernel/sync/atomic.rs b/rust/kernel/sync/atomic.rs
> > index 3afc376be42d9..c07a53f8360b4 100644
> > --- a/rust/kernel/sync/atomic.rs
> > +++ b/rust/kernel/sync/atomic.rs
> > @@ -21,8 +21,8 @@
> > mod predefine;
> >
> > pub use internal::AtomicImpl;
> > -pub use ordering::{Acquire, Full, Relaxed, Release};
> > pub(crate) use internal::{AtomicArithmeticOps, AtomicBasicOps, AtomicExchangeOps};
> > +pub use ordering::{Acquire, Full, Relaxed, Release};
>
> Just fyi, there is a (trivial) conflict of this with Miguel's recently
> merged
>
I think what Lyude has here is probably automatically added by rustfmt,
rebasing on v6.19-rc1 should avoid this.
Regards,
Boqun
> commit 309e49039f124a ("rust: sync: atomic: separate import "blocks"")
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/rust/kernel/sync/atomic.rs?id=309e49039f124a9dcb99c05651af8eb8fa05bc29
>
> If I haven't missed anything this is just to fix the alphabetical
> order? So maybe this should go as an independent patch like Miguel's one?
>
> Dirk