Tamir Duberstein
2025-Jul-04 20:16 UTC
[PATCH 4/6] rust: str: remove unnecessary qualification
`core::ffi::*` is in the prelude, which is imported here.
Signed-off-by: Tamir Duberstein <tamird at gmail.com>
---
rust/kernel/str.rs | 4 ++--
1 file 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 @@ pub const fn is_empty(&self) -> bool {
/// 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 @@ pub unsafe fn from_bytes_with_nul_unchecked_mut(bytes:
&mut [u8]) -> &mut 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()
}
--
2.50.0
Benno Lossin
2025-Jul-05 08:04 UTC
[PATCH 4/6] rust: str: remove unnecessary qualification
On Fri Jul 4, 2025 at 10:14 PM CEST, Tamir Duberstein wrote:> `core::ffi::*` is in the prelude, which is imported here. > > Signed-off-by: Tamir Duberstein <tamird at gmail.com>Reviewed-by: Benno Lossin <lossin at kernel.org> --- Cheers, Benno> --- > rust/kernel/str.rs | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-)
On Fri, Jul 4, 2025 at 10:16?PM Tamir Duberstein <tamird at gmail.com> wrote:> > `core::ffi::*` is in the prelude, which is imported here. > > Signed-off-by: Tamir Duberstein <tamird at gmail.com>Reviewed-by: Alice Ryhl <aliceryhl at google.com>