diff options
| author | Maarten Lankhorst <dev@lankhorst.se> | 2026-06-29 17:58:00 +0200 |
|---|---|---|
| committer | Maarten Lankhorst <dev@lankhorst.se> | 2026-06-29 17:58:00 +0200 |
| commit | 00599d4841790d05401820a96cf7edb193888b00 (patch) | |
| tree | 892401ad6f7973cda18d1ebd75910702611898b4 /rust/kernel/alloc/allocator.rs | |
| parent | 77a9298741f8f9e8b963c977f5582ab21c6d3427 (diff) | |
| parent | dc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff) | |
Merge drm/drm-fixes into drm-misc-fixes
Pull in tag v7.2-rc1 so that drm-misc-fixes becomes useful again,
and drm-misc-next-fixes can be closed.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
Diffstat (limited to 'rust/kernel/alloc/allocator.rs')
| -rw-r--r-- | rust/kernel/alloc/allocator.rs | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/rust/kernel/alloc/allocator.rs b/rust/kernel/alloc/allocator.rs index 63bfb91b3671..cd4203f27aed 100644 --- a/rust/kernel/alloc/allocator.rs +++ b/rust/kernel/alloc/allocator.rs @@ -8,14 +8,25 @@ //! //! Reference: <https://docs.kernel.org/core-api/memory-allocation.html> -use super::Flags; -use core::alloc::Layout; -use core::ptr; -use core::ptr::NonNull; - -use crate::alloc::{AllocError, Allocator, NumaNode}; -use crate::bindings; -use crate::page; +use super::{ + AllocError, + Allocator, + Flags, + NumaNode, // +}; + +use crate::{ + bindings, + page, // +}; + +use core::{ + alloc::Layout, + ptr::{ + self, + NonNull, // + }, // +}; const ARCH_KMALLOC_MINALIGN: usize = bindings::ARCH_KMALLOC_MINALIGN; @@ -163,8 +174,11 @@ impl Vmalloc { /// # Examples /// /// ``` - /// # use core::ptr::{NonNull, from_mut}; - /// # use kernel::{page, prelude::*}; + /// # use core::ptr::{ + /// # from_mut, + /// # NonNull, // + /// # }; + /// # use kernel::page; /// use kernel::alloc::allocator::Vmalloc; /// /// let mut vbox = VBox::<[u8; page::PAGE_SIZE]>::new_uninit(GFP_KERNEL)?; @@ -251,6 +265,7 @@ unsafe impl Allocator for KVmalloc { } } +#[cfg(CONFIG_RUST_ALLOCATOR_KUNIT_TEST)] #[macros::kunit_tests(rust_allocator)] mod tests { use super::*; |
