Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: i2c: replace `kernel::c_str!` with C-Strings

C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Acked-by: Igor Korotin <igor.korotin.linux@gmail.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://patch.msgid.link/20251222-cstr-i2c-v1-1-df1c258d4615@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
eeaad2f0 84b1b49e

+4 -4
+4 -4
rust/kernel/i2c.rs
··· 253 253 /// # Example 254 254 /// 255 255 ///``` 256 - /// # use kernel::{acpi, bindings, c_str, device::Core, i2c, of}; 256 + /// # use kernel::{acpi, bindings, device::Core, i2c, of}; 257 257 /// 258 258 /// struct MyDriver; 259 259 /// ··· 262 262 /// MODULE_ACPI_TABLE, 263 263 /// <MyDriver as i2c::Driver>::IdInfo, 264 264 /// [ 265 - /// (acpi::DeviceId::new(c_str!("LNUXBEEF")), ()) 265 + /// (acpi::DeviceId::new(c"LNUXBEEF"), ()) 266 266 /// ] 267 267 /// ); 268 268 /// ··· 271 271 /// MODULE_I2C_TABLE, 272 272 /// <MyDriver as i2c::Driver>::IdInfo, 273 273 /// [ 274 - /// (i2c::DeviceId::new(c_str!("rust_driver_i2c")), ()) 274 + /// (i2c::DeviceId::new(c"rust_driver_i2c"), ()) 275 275 /// ] 276 276 /// ); 277 277 /// ··· 280 280 /// MODULE_OF_TABLE, 281 281 /// <MyDriver as i2c::Driver>::IdInfo, 282 282 /// [ 283 - /// (of::DeviceId::new(c_str!("test,device")), ()) 283 + /// (of::DeviceId::new(c"test,device"), ()) 284 284 /// ] 285 285 /// ); 286 286 ///