rust: kunit: use crate-level mapping for `c_void`
PATCH v2 1/1 rust: kunit: use crate-level mapping for `c_void`
Use kernel::ffi::c_void instead of core::ffi::c_void for consistency and to centralize abstraction.
Since kernel::ffi::c_void is a straightforward re-export of core::ffi::c_void, both are functionally equivalent. However, using kernel::ffi::c_void improves consistency across the kernel's Rust code and provides a unified reference point in case the definition ever needs to change, even if such a change is unlikely.
---
So in sum, I believe it's reasonable to keep the diff unchanged... but
I'm happy to adjust if you'd prefer a different approach.
---
Changes in v2:
- Add "Link" tag to the related discussion on Zulip
- Reword the commit message to clarify kernel::ffi::c_void is a re-export
- Link to v1: https://lore.kernel.org/rust-for-linux/[email protected]/
--- rust/kernel/kunit.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
rust/kernel/kunit.rs +2 -1
@@ -6,7 +6,8 @@//! //! Reference: <https://docs.kernel.org/dev-tools/kunit/index.html> -use core::{ffi::c_void, fmt}; +use core::fmt; +use kernel::ffi::c_void;/// Prints a KUnit error-level message. ///
base-commit: f4daa80d6be7d3c55ca72a8e560afc4e21f886aa
Signature · 1 line
2.39.5
Quoted 3 lines · Jesung Yang
So in sum, I believe it's reasonable to keep the diff unchanged... but I'm happy to adjust if you'd prefer a different approach.
I see this is based on rust-next -- if you rebase the patch on top of the latest one, you will see the prelude there :)
Thanks!
Cheers,
Miguel
Quoted 3 lines · Miguel Ojeda
I see this is based on rust-next -- if you rebase the patch on top of the latest one, you will see the prelude there :)
Thanks for the heads up! I'll rebase and send out v3 accordingly.
Best regards,
Jesung