[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260126-zeroable-ffi-v1-3-0ef101d1ed85@google.com>
Date: Mon, 26 Jan 2026 13:05:16 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
"Björn Roy Baron" <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>, Igor Korotin <igor.korotin.linux@...il.com>,
Daniel Almeida <daniel.almeida@...labora.com>, Len Brown <lenb@...nel.org>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, linux-acpi@...r.kernel.org,
Alice Ryhl <aliceryhl@...gle.com>
Subject: [PATCH 3/4] rust: i2c: import pin_init::zeroed() from ffi
The zeroed() helper was re-exported from the ffi crate. As this usage of
zeroed() has nothing to do with pin-init, use the new re-export.
Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
---
rust/kernel/i2c.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/kernel/i2c.rs b/rust/kernel/i2c.rs
index 491e6cc25cf42619ebfd88af731db47efb8db93c..731bacff0990c8b9b2fe8601f07470b68032f3e8 100644
--- a/rust/kernel/i2c.rs
+++ b/rust/kernel/i2c.rs
@@ -46,7 +46,7 @@ impl DeviceId {
pub const fn new(id: &'static CStr) -> Self {
let src = id.to_bytes_with_nul();
build_assert!(src.len() <= Self::I2C_NAME_SIZE, "ID exceeds 20 bytes");
- let mut i2c: bindings::i2c_device_id = pin_init::zeroed();
+ let mut i2c: bindings::i2c_device_id = ffi::zeroed();
let mut i = 0;
while i < src.len() {
i2c.name[i] = src[i];
@@ -433,7 +433,7 @@ impl I2cBoardInfo {
pub const fn new(type_: &'static CStr, addr: u16) -> Self {
let src = type_.to_bytes_with_nul();
build_assert!(src.len() <= Self::I2C_TYPE_SIZE, "Type exceeds 20 bytes");
- let mut i2c_board_info: bindings::i2c_board_info = pin_init::zeroed();
+ let mut i2c_board_info: bindings::i2c_board_info = ffi::zeroed();
let mut i: usize = 0;
while i < src.len() {
i2c_board_info.type_[i] = src[i];
--
2.52.0.457.g6b5491de43-goog
Powered by blists - more mailing lists