Commit 9b5cdd5f authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Greg Kroah-Hartman
Browse files

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: default avatarFUJITA Tomonori <fujita.tomonori@gmail.com>
Link: https://lore.kernel.org/r/20250623225846.169805-1-fujita.tomonori@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f5d3ef25
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ fn acpi_id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> {
            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::<acpi::DeviceId>() };

@@ -200,7 +200,7 @@ fn of_id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> {
            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::<of::DeviceId>() };

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
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 {
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ extern "C" fn probe_callback(
        // INVARIANT: `pdev` is valid for the duration of `probe_callback()`.
        let pdev = unsafe { &*pdev.cast::<Device<device::Core>>() };

        // 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::<DeviceId>() };
        let info = T::ID_TABLE.info(id.index());
@@ -161,7 +161,7 @@ pub const fn from_class(class: u32, class_mask: u32) -> Self {
}

// 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 {