From: FUJITA Tomonori Date: Mon, 23 Jun 2025 22:58:46 +0000 (+0900) Subject: rust: fix typo in #[repr(transparent)] comments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b5cdd5f40191d11d3b535ab7978751a4a3e4bc5;p=thirdparty%2Flinux.git rust: fix typo in #[repr(transparent)] comments Fix a typo in several comments where `#[repr(transparent)]` was mistakenly written as `#[repr(transparent)` (missing closing bracket). Signed-off-by: FUJITA Tomonori Link: https://lore.kernel.org/r/20250623225846.169805-1-fujita.tomonori@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs index a4bf4498e592a..f8dd7593e8dcd 100644 --- a/rust/kernel/driver.rs +++ b/rust/kernel/driver.rs @@ -166,7 +166,7 @@ pub trait Adapter { if raw_id.is_null() { None } else { - // SAFETY: `DeviceId` is a `#[repr(transparent)` wrapper of `struct acpi_device_id` + // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `struct acpi_device_id` // and does not add additional invariants, so it's safe to transmute. let id = unsafe { &*raw_id.cast::() }; @@ -200,7 +200,7 @@ pub trait Adapter { if raw_id.is_null() { None } else { - // SAFETY: `DeviceId` is a `#[repr(transparent)` wrapper of `struct of_device_id` + // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `struct of_device_id` // and does not add additional invariants, so it's safe to transmute. let id = unsafe { &*raw_id.cast::() }; diff --git a/rust/kernel/of.rs b/rust/kernel/of.rs index 04f2d8ef29cb9..52fe0c77b9a15 100644 --- a/rust/kernel/of.rs +++ b/rust/kernel/of.rs @@ -13,7 +13,7 @@ pub type IdTable = &'static dyn kernel::device_id::IdTable; pub struct DeviceId(bindings::of_device_id); // SAFETY: -// * `DeviceId` is a `#[repr(transparent)` wrapper of `struct of_device_id` and does not add +// * `DeviceId` is a `#[repr(transparent)]` wrapper of `struct of_device_id` and does not add // additional invariants, so it's safe to transmute to `RawType`. // * `DRIVER_DATA_OFFSET` is the offset to the `data` field. unsafe impl RawDeviceId for DeviceId { diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs index db0eb7eaf9b10..9afe2a8ed6372 100644 --- a/rust/kernel/pci.rs +++ b/rust/kernel/pci.rs @@ -67,7 +67,7 @@ impl Adapter { // INVARIANT: `pdev` is valid for the duration of `probe_callback()`. let pdev = unsafe { &*pdev.cast::>() }; - // SAFETY: `DeviceId` is a `#[repr(transparent)` wrapper of `struct pci_device_id` and + // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `struct pci_device_id` and // does not add additional invariants, so it's safe to transmute. let id = unsafe { &*id.cast::() }; let info = T::ID_TABLE.info(id.index()); @@ -161,7 +161,7 @@ impl DeviceId { } // SAFETY: -// * `DeviceId` is a `#[repr(transparent)` wrapper of `pci_device_id` and does not add +// * `DeviceId` is a `#[repr(transparent)]` wrapper of `pci_device_id` and does not add // additional invariants, so it's safe to transmute to `RawType`. // * `DRIVER_DATA_OFFSET` is the offset to the `driver_data` field. unsafe impl RawDeviceId for DeviceId {