aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2025-07-04 16:14:55 -0400
committerMiguel Ojeda <ojeda@kernel.org>2025-07-21 01:16:36 +0200
commit0f6d225671e05bd84b426823152b77a8db580f92 (patch)
tree3c137602f754cf42db6430893d0009d384d9d5d3
parentrust: use `kernel::{fmt,prelude::fmt!}` (diff)
downloadwireguard-linux-0f6d225671e05bd84b426823152b77a8db580f92.tar.xz
wireguard-linux-0f6d225671e05bd84b426823152b77a8db580f92.zip
rust: str: remove unnecessary qualification
`core::ffi::*` is in the prelude, which is imported here. Signed-off-by: Tamir Duberstein <tamird@gmail.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-4-a91524037783@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
-rw-r--r--rust/kernel/str.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index 48d9a518db96..f326f0c40ab0 100644
--- a/rust/kernel/str.rs
+++ b/rust/kernel/str.rs
@@ -232,7 +232,7 @@ impl CStr {
/// last at least `'a`. When `CStr` is alive, the memory pointed by `ptr`
/// must not be mutated.
#[inline]
- pub unsafe fn from_char_ptr<'a>(ptr: *const crate::ffi::c_char) -> &'a Self {
+ pub unsafe fn from_char_ptr<'a>(ptr: *const c_char) -> &'a Self {
// SAFETY: The safety precondition guarantees `ptr` is a valid pointer
// to a `NUL`-terminated C string.
let len = unsafe { bindings::strlen(ptr) } + 1;
@@ -295,7 +295,7 @@ impl CStr {
/// Returns a C pointer to the string.
#[inline]
- pub const fn as_char_ptr(&self) -> *const crate::ffi::c_char {
+ pub const fn as_char_ptr(&self) -> *const c_char {
self.0.as_ptr()
}