diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-06-22 15:29:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-06-22 15:29:49 -0700 |
commit | 5f583a3162ffd9f7999af76b8ab634ce2dac9f90 (patch) | |
tree | 9b30306026c4cf38db384de065d9aec4c66155da | |
parent | 2765de94dd3823fb1db1c939b07cc3e0a93e613e (diff) | |
parent | a126eca844353360ebafa9088d22865cb8e022e3 (diff) | |
download | linux-5f583a3162ffd9f7999af76b8ab634ce2dac9f90.tar.gz linux-5f583a3162ffd9f7999af76b8ab634ce2dac9f90.tar.bz2 linux-5f583a3162ffd9f7999af76b8ab634ce2dac9f90.zip |
Merge tag 'rust-fixes-6.10' of https://github.com/Rust-for-Linux/linux
Pull rust fix from Miguel Ojeda:
- Avoid unused import warning in 'rusttest'.
* tag 'rust-fixes-6.10' of https://github.com/Rust-for-Linux/linux:
rust: avoid unused import warning in `rusttest`
-rw-r--r-- | rust/kernel/alloc/vec_ext.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rust/kernel/alloc/vec_ext.rs b/rust/kernel/alloc/vec_ext.rs index e9a81052728a..1297a4be32e8 100644 --- a/rust/kernel/alloc/vec_ext.rs +++ b/rust/kernel/alloc/vec_ext.rs @@ -4,7 +4,6 @@ use super::{AllocError, Flags}; use alloc::vec::Vec; -use core::ptr; /// Extensions to [`Vec`]. pub trait VecExt<T>: Sized { @@ -141,7 +140,11 @@ impl<T> VecExt<T> for Vec<T> { // `krealloc_aligned`. A `Vec<T>`'s `ptr` value is not guaranteed to be NULL and might be // dangling after being created with `Vec::new`. Instead, we can rely on `Vec<T>`'s capacity // to be zero if no memory has been allocated yet. - let ptr = if cap == 0 { ptr::null_mut() } else { old_ptr }; + let ptr = if cap == 0 { + core::ptr::null_mut() + } else { + old_ptr + }; // SAFETY: `ptr` is valid because it's either NULL or comes from a previous call to // `krealloc_aligned`. We also verified that the type is not a ZST. |