summaryrefslogtreecommitdiff
path: root/rust/kernel/lib.rs
diff options
context:
space:
mode:
authorAliet Exposito Garcia <aliet.exposito@gmail.com>2024-09-18 18:51:14 -0400
committerMiguel Ojeda <ojeda@kernel.org>2024-10-10 00:33:42 +0200
commitce1c54fdff7c4556b08f5b875a331d8952e8b6b7 (patch)
tree17a00cf119f148462d4946c67f2868db640b8ac1 /rust/kernel/lib.rs
parente9759c5b9ea555d09f426c70c880e9522e9b0576 (diff)
rust: kernel: move `FromBytes` and `AsBytes` traits to a new `transmute` module
Refactor the `FromBytes` and `AsBytes` traits from `types.rs` into a new `transmute.rs` module: - Add `rust/kernel/transmute.rs` with the definitions of `FromBytes` and `AsBytes`. - Remove the same trait definitions from `rust/kernel/types.rs`. - Update `rust/kernel/uaccess.rs` to import `AsBytes` and `FromBytes` from `transmute.rs`. The traits and their implementations remain unchanged. Suggested-by: Benno Lossin <benno.lossin@proton.me> Link: https://github.com/Rust-for-Linux/linux/issues/1117 Signed-off-by: Aliet Exposito Garcia <aliet.exposito@gmail.com> Reviewed-by: Fiona Behrens <me@kloenk.dev> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20240918225115.2309224-2-aliet.exposito@gmail.com [ Rebased on top of the lints series and slightly reworded. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/lib.rs')
-rw-r--r--rust/kernel/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
index 3e4bd6e57bee..dc37aef6a008 100644
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@ -54,6 +54,7 @@ pub mod str;
pub mod sync;
pub mod task;
pub mod time;
+pub mod transmute;
pub mod types;
pub mod uaccess;
pub mod workqueue;