]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: device_id: replace incorrect word in safety documentation
authorYilin Chen <1479826151@qq.com>
Sun, 28 Dec 2025 16:53:44 +0000 (00:53 +0800)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 29 Dec 2025 13:09:18 +0000 (14:09 +0100)
The safety documentation incorrectly refers to `RawDeviceId` when
transmuting to `RawType`. This fixes the documentation to correctly
indicate that implementers must ensure layout compatibility with
`RawType`, not `RawDeviceId`.

Fixes: 9b90864bb42b ("rust: implement `IdArray`, `IdTable` and `RawDeviceId`")
Signed-off-by: Yilin Chen <1479826151@qq.com>
Link: https://patch.msgid.link/tencent_C18DD5047749311142ED455779C7CCCF3A08@qq.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/device_id.rs

index 62c42da12e9deccd7c402f53417f90f922b3f2be..8e97214460146e8deba3b612ddf5aff4108554e4 100644 (file)
@@ -15,7 +15,7 @@ use core::mem::MaybeUninit;
 /// # Safety
 ///
 /// Implementers must ensure that `Self` is layout-compatible with [`RawDeviceId::RawType`];
-/// i.e. it's safe to transmute to `RawDeviceId`.
+/// i.e. it's safe to transmute to `RawType`.
 ///
 /// This requirement is needed so `IdArray::new` can convert `Self` to `RawType` when building
 /// the ID table.