Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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>

authored by

Yilin Chen and committed by
Danilo Krummrich
3691fd19 68ece1e2

+1 -1
+1 -1
rust/kernel/device_id.rs
··· 15 15 /// # Safety 16 16 /// 17 17 /// Implementers must ensure that `Self` is layout-compatible with [`RawDeviceId::RawType`]; 18 - /// i.e. it's safe to transmute to `RawDeviceId`. 18 + /// i.e. it's safe to transmute to `RawType`. 19 19 /// 20 20 /// This requirement is needed so `IdArray::new` can convert `Self` to `RawType` when building 21 21 /// the ID table.