diff options
| author | Gary Guo <gary@garyguo.net> | 2026-01-23 17:58:39 +0000 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-01-24 01:12:49 +0100 |
| commit | 600de1c008b2302b56d69ff27d12a9d8d14892ac (patch) | |
| tree | 6c8448a9a8322a20d8e816f42fbfeead07a6684c | |
| parent | a38cd1fea98990e20021823cea251e6cb088eeab (diff) | |
rust: pci: remove redundant `.as_ref()` for `dev_*` print
This is now handled by the macro itself.
Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260123175854.176735-2-gary@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
| -rw-r--r-- | rust/kernel/pci.rs | 2 | ||||
| -rw-r--r-- | rust/kernel/pci/id.rs | 2 | ||||
| -rw-r--r-- | samples/rust/rust_driver_pci.rs | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs index 1d1a253e5d5d..cd46ac12812c 100644 --- a/rust/kernel/pci.rs +++ b/rust/kernel/pci.rs @@ -348,7 +348,7 @@ impl Device { /// // Get an instance of `Vendor`. /// let vendor = pdev.vendor_id(); /// dev_info!( - /// pdev.as_ref(), + /// pdev, /// "Device: Vendor={}, Device=0x{:x}\n", /// vendor, /// pdev.device_id() diff --git a/rust/kernel/pci/id.rs b/rust/kernel/pci/id.rs index c09125946d9e..e2d9e8804347 100644 --- a/rust/kernel/pci/id.rs +++ b/rust/kernel/pci/id.rs @@ -22,7 +22,7 @@ use crate::{ /// fn probe_device(pdev: &pci::Device<Core>) -> Result { /// let pci_class = pdev.pci_class(); /// dev_info!( -/// pdev.as_ref(), +/// pdev, /// "Detected PCI class: {}\n", /// pci_class /// ); diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs index 8eea79e858a2..4dfb8a6a4707 100644 --- a/samples/rust/rust_driver_pci.rs +++ b/samples/rust/rust_driver_pci.rs @@ -101,7 +101,7 @@ impl pci::Driver for SampleDriver { pin_init::pin_init_scope(move || { let vendor = pdev.vendor_id(); dev_dbg!( - pdev.as_ref(), + pdev, "Probe Rust PCI driver sample (PCI ID: {}, 0x{:x}).\n", vendor, pdev.device_id() @@ -117,7 +117,7 @@ impl pci::Driver for SampleDriver { let bar = bar.access(pdev.as_ref())?; dev_info!( - pdev.as_ref(), + pdev, "pci-testdev data-match count: {}\n", Self::testdev(info, bar)? ); @@ -139,7 +139,7 @@ impl pci::Driver for SampleDriver { #[pinned_drop] impl PinnedDrop for SampleDriver { fn drop(self: Pin<&mut Self>) { - dev_dbg!(self.pdev.as_ref(), "Remove Rust PCI driver sample.\n"); + dev_dbg!(self.pdev, "Remove Rust PCI driver sample.\n"); } } |
