[PATCH v1] rust: fix typo in #[repr(transparent)] comments

FUJITA Tomonori posted 1 patch 3 months, 2 weeks ago
rust/kernel/driver.rs | 2 +-
rust/kernel/of.rs     | 2 +-
rust/kernel/pci.rs    | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
[PATCH v1] rust: fix typo in #[repr(transparent)] comments
Posted by FUJITA Tomonori 3 months, 2 weeks ago
Fix a typo in several comments where `#[repr(transparent)]` was
mistakenly written as `#[repr(transparent)` (missing closing
bracket).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
 rust/kernel/driver.rs | 2 +-
 rust/kernel/of.rs     | 2 +-
 rust/kernel/pci.rs    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs
index ec9166cedfa7..de4ed5dafa96 100644
--- a/rust/kernel/driver.rs
+++ b/rust/kernel/driver.rs
@@ -159,7 +159,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` and
+            // 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>() };
 
diff --git a/rust/kernel/of.rs b/rust/kernel/of.rs
index 40d1bd13682c..cca3d5cfaa92 100644
--- a/rust/kernel/of.rs
+++ b/rust/kernel/of.rs
@@ -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 {
diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
index f6b19764ad17..dc1516ce0bdc 100644
--- a/rust/kernel/pci.rs
+++ b/rust/kernel/pci.rs
@@ -68,7 +68,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());
@@ -162,7 +162,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 {

base-commit: dc35ddcf97e99b18559d0855071030e664aae44d
-- 
2.43.0
Re: [PATCH v1] rust: fix typo in #[repr(transparent)] comments
Posted by Miguel Ojeda 3 months, 2 weeks ago
On Tue, Jun 24, 2025 at 12:59 AM FUJITA Tomonori
<fujita.tomonori@gmail.com> wrote:
>
> Fix a typo in several comments where `#[repr(transparent)]` was
> mistakenly written as `#[repr(transparent)` (missing closing
> bracket).
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

Thanks for fixing the typo!

Looks fine to me.

Cheers,
Miguel
Re: [PATCH v1] rust: fix typo in #[repr(transparent)] comments
Posted by Greg KH 3 months, 1 week ago
On Tue, Jun 24, 2025 at 01:15:18AM +0200, Miguel Ojeda wrote:
> On Tue, Jun 24, 2025 at 12:59 AM FUJITA Tomonori
> <fujita.tomonori@gmail.com> wrote:
> >
> > Fix a typo in several comments where `#[repr(transparent)]` was
> > mistakenly written as `#[repr(transparent)` (missing closing
> > bracket).
> >
> > Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> 
> Thanks for fixing the typo!
> 
> Looks fine to me.

Thanks, I'll take this through the driver-core tree.

greg k-h