From: "Danilo Krummrich" <dakr@kernel.org>
To: "Miguel Ojeda" <ojeda@kernel.org>
Cc: "Igor Korotin" <igor.korotin.linux@gmail.com>,
"Stephen Rothwell" <sfr@canb.auug.org.au>,
"Greg KH" <greg@kroah.com>, "Alex Gaynor" <alex.gaynor@gmail.com>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
rust-for-linux@vger.kernel.org,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
linux-kernel@vger.kernel.org, patches@lists.linux.dev
Subject: Re: [PATCH] rust: i2c: prepare for `core::ffi::CStr`
Date: Mon, 24 Nov 2025 09:25:44 +1300 [thread overview]
Message-ID: <DEGCU5OZP560.SWESWJ4G920F@kernel.org> (raw)
In-Reply-To: <20251123163536.1771801-1-ojeda@kernel.org>
On Mon Nov 24, 2025 at 5:35 AM NZDT, Miguel Ojeda wrote:
> The rust-next tree contains commit:
>
> 3b83f5d5e78a ("rust: replace `CStr` with `core::ffi::CStr`")
>
> which, when merged together with commits:
>
> 57c5bd9aee94 ("rust: i2c: add basic I2C device and driver abstractions")
> f3cc26a417b7 ("rust: i2c: add manual I2C device creation abstractions")
>
> from this tree (driver-core), produces errors like the following:
>
> error[E0599]: no method named `len_with_nul` found for reference `&'static ffi::CStr` in the current scope
> --> rust/kernel/i2c.rs:48:16
> |
> 48 | id.len_with_nul() <= Self::I2C_NAME_SIZE,
> | ^^^^^^^^^^^^ method not found in `&CStr`
>
> error[E0599]: no method named `as_bytes_with_nul` found for reference `&'static ffi::CStr` in the current scope
> --> rust/kernel/i2c.rs:51:22
> |
> 51 | let src = id.as_bytes_with_nul();
> | ^^^^^^^^^^^^^^^^^
> |
> help: there is a method `to_bytes_with_nul` with a similar name
> |
> 51 | let src = id.to_bytes_with_nul();
> | ~~~~~~~~~~~~~~~~~
>
> which were detected in linux-next by Stephen [1].
>
> The `i2c` code can be independently prepared to be ready for the change,
> thus do so.
>
> The change is similar to the one done by Tamir in commit 657403637f7d
> ("rust: acpi: use `core::ffi::CStr` method names").
>
> Link: https://lore.kernel.org/all/20251120181111.65ce75a0@canb.auug.org.au/ [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Applied to driver-core-next, thanks!
prev parent reply other threads:[~2025-11-23 20:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-23 16:35 [PATCH] rust: i2c: prepare for `core::ffi::CStr` Miguel Ojeda
2025-11-23 20:25 ` Danilo Krummrich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DEGCU5OZP560.SWESWJ4G920F@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=greg@kroah.com \
--cc=igor.korotin.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=patches@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).