From: Tamir Duberstein Date: Fri, 4 Jul 2025 20:14:55 +0000 (-0400) Subject: rust: str: remove unnecessary qualification X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f6d225671e05bd84b426823152b77a8db580f92;p=thirdparty%2Fkernel%2Flinux.git rust: str: remove unnecessary qualification `core::ffi::*` is in the prelude, which is imported here. Signed-off-by: Tamir Duberstein Reviewed-by: Benno Lossin Reviewed-by: Alice Ryhl Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-4-a91524037783@gmail.com Signed-off-by: Miguel Ojeda --- diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index 48d9a518db962..f326f0c40ab04 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() }