]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: str: remove unnecessary qualification
authorTamir Duberstein <tamird@gmail.com>
Fri, 4 Jul 2025 20:14:55 +0000 (16:14 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 20 Jul 2025 23:16:36 +0000 (01:16 +0200)
`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>
rust/kernel/str.rs

index 48d9a518db9622590962e7819f9b8192e044e597..f326f0c40ab0473845325c8e01f2e1c0d8654803 100644 (file)
@@ -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()
     }