mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
rust: device_id: replace incorrect word in safety documentation
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: 9b90864bb4 ("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>
This commit is contained in:
committed by
Danilo Krummrich
parent
68ece1e2ce
commit
3691fd19cc
@@ -15,7 +15,7 @@ use core::mem::MaybeUninit;
|
|||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// Implementers must ensure that `Self` is layout-compatible with [`RawDeviceId::RawType`];
|
/// 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
|
/// This requirement is needed so `IdArray::new` can convert `Self` to `RawType` when building
|
||||||
/// the ID table.
|
/// the ID table.
|
||||||
|
|||||||
Reference in New Issue
Block a user