[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f2385851-87c0-44d1-8e1c-4e5553aa1893@linux.dev>
Date: Tue, 27 Jan 2026 18:52:40 +0000
From: Igor Korotin <igor.korotin@...ux.dev>
To: Gary Guo <gary@...yguo.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Igor Korotin <igor.korotin.linux@...il.com>,
Daniel Almeida <daniel.almeida@...labora.com>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/8] rust: samples: i2c: remove redundant `.as_ref()`
for `dev_*` print
Hi
On 1/23/2026 5:58 PM, Gary Guo wrote:
> From: Gary Guo <gary@...yguo.net>
>
> This is now handled by the macro itself.
>
> Signed-off-by: Gary Guo <gary@...yguo.net>
> ---
> samples/rust/rust_driver_i2c.rs | 10 ++++------
> samples/rust/rust_i2c_client.rs | 10 ++--------
> 2 files changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/samples/rust/rust_driver_i2c.rs b/samples/rust/rust_driver_i2c.rs
> index 6be79f9e9fb5..3079d57fe473 100644
> --- a/samples/rust/rust_driver_i2c.rs
> +++ b/samples/rust/rust_driver_i2c.rs
> @@ -44,23 +44,21 @@ fn probe(
> idev: &i2c::I2cClient<Core>,
> info: Option<&Self::IdInfo>,
> ) -> impl PinInit<Self, Error> {
> - let dev = idev.as_ref();
> -
> - dev_info!(dev, "Probe Rust I2C driver sample.\n");
> + dev_info!(idev, "Probe Rust I2C driver sample.\n");
>
> if let Some(info) = info {
> - dev_info!(dev, "Probed with info: '{}'.\n", info);
> + dev_info!(idev, "Probed with info: '{}'.\n", info);
> }
>
> Ok(Self)
> }
>
> fn shutdown(idev: &i2c::I2cClient<Core>, _this: Pin<&Self>) {
> - dev_info!(idev.as_ref(), "Shutdown Rust I2C driver sample.\n");
> + dev_info!(idev, "Shutdown Rust I2C driver sample.\n");
> }
>
> fn unbind(idev: &i2c::I2cClient<Core>, _this: Pin<&Self>) {
> - dev_info!(idev.as_ref(), "Unbind Rust I2C driver sample.\n");
> + dev_info!(idev, "Unbind Rust I2C driver sample.\n");
> }
> }
>
> diff --git a/samples/rust/rust_i2c_client.rs b/samples/rust/rust_i2c_client.rs
> index 8d2c12e535b0..72da5499f150 100644
> --- a/samples/rust/rust_i2c_client.rs
> +++ b/samples/rust/rust_i2c_client.rs
> @@ -113,10 +113,7 @@ fn probe(
> pdev: &platform::Device<device::Core>,
> _info: Option<&Self::IdInfo>,
> ) -> impl PinInit<Self, Error> {
> - dev_info!(
> - pdev.as_ref(),
> - "Probe Rust I2C Client registration sample.\n"
> - );
> + dev_info!(pdev, "Probe Rust I2C Client registration sample.\n");
>
> kernel::try_pin_init!( Self {
> parent_dev: pdev.into(),
> @@ -130,10 +127,7 @@ fn probe(
> }
>
> fn unbind(pdev: &platform::Device<device::Core>, _this: Pin<&Self>) {
> - dev_info!(
> - pdev.as_ref(),
> - "Unbind Rust I2C Client registration sample.\n"
> - );
> + dev_info!(pdev, "Unbind Rust I2C Client registration sample.\n");
> }
> }
>
Acked-by: Igor Korotin <igor.korotin.linux@...il.com>
Thanks
Igor
Powered by blists - more mailing lists