Re: [PATCH 2/5] rust: sync: add const constructor for raw_spinlock_t
From: Alice Ryhl
Date: Tue Jul 07 2026 - 09:23:24 EST
On Fri, Jun 26, 2026 at 08:52:54PM +0000, Carlos Llamas wrote:
> On Tue, Jun 23, 2026 at 03:38:05PM +0000, Alice Ryhl wrote:
> > +// Explicitly list architectures where this logic is checked correct.
> > +#[cfg(any(
> > + CONFIG_ARM,
> > + CONFIG_ARM64,
> > + CONFIG_LOONGARCH,
> > + CONFIG_PPC,
> > + CONFIG_RISCV,
> > + CONFIG_S390,
> > + CONFIG_X86,
> > +))]
>
> I guess this is done explicitly because we can't test if
> __ARCH_SPIN_LOCK_UNLOCKED is defined by the arch?
There are some arches where zeros is not the right value here, so when
someone adds Rust on a new arch, I want to make sure that person has to
look at this function and determine whether all-zeros is valid for that
particular arch or not.
> Looks good to me,
>
> Reviewed-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
Thanks!
Alice