Re: [PATCH 10/10] rust: xarray: fix false positive lockdep warnings

From: Andreas Hindborg

Date: Fri Feb 06 2026 - 09:24:33 EST


Tamir Duberstein <tamird@xxxxxxxxx> writes:

> On Wed, Dec 3, 2025 at 5:28 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>>

<cut>

>> @@ -62,9 +77,10 @@
>> ///
>> /// ```rust
>> /// use kernel::alloc::KBox;
>> -/// use kernel::xarray::{AllocKind, XArray};
>> +/// use kernel::xarray::{new_xarray, AllocKind, XArray};
>> ///
>> -/// let xa = KBox::pin_init(XArray::new(AllocKind::Alloc1), GFP_KERNEL)?;
>> +/// let xa: Pin<KBox<XArray<KBox<u32>>>> =
>> +/// KBox::pin_init(new_xarray!(AllocKind::Alloc1), GFP_KERNEL)?;
>> ///
>> /// let dead = KBox::new(0xdead, GFP_KERNEL)?;
>> /// let beef = KBox::new(0xbeef, GFP_KERNEL)?;
>> @@ -124,7 +140,11 @@ pub enum AllocKind {
>>
>> impl<T: ForeignOwnable> XArray<T> {
>> /// Creates a new initializer for this type.
>
> Should this be #[doc(hidden)] now?

No, I think users should be free to vall this if they want to.


Best regards,
Andreas Hindborg