Commit 0250ea32 authored by Tamir Duberstein's avatar Tamir Duberstein Committed by Danilo Krummrich
Browse files

rust: io: 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: default avatarTamir Duberstein <tamird@gmail.com>
Reviewed-by: default avatarDaniel Almeida <daniel.almeida@collabora.com>
Link: https://patch.msgid.link/20251222-cstr-driver-core-v1-4-1142a177d0fd@gmail.com


[ Use kernel vertical import style. - Danilo ]
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent 1114c87e
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
use core::ops::Deref;

use crate::{
    c_str,
    device::{
        Bound,
        Device, //
@@ -52,7 +51,12 @@ pub(crate) unsafe fn new(device: &'a Device<Bound>, resource: &'a Resource) -> S
    /// illustration purposes.
    ///
    /// ```no_run
    /// use kernel::{bindings, c_str, platform, of, device::Core};
    /// use kernel::{
    ///     bindings,
    ///     device::Core,
    ///     of,
    ///     platform,
    /// };
    /// struct SampleDriver;
    ///
    /// impl platform::Driver for SampleDriver {
@@ -110,7 +114,12 @@ pub fn iomap_exclusive_sized<const SIZE: usize>(
    /// illustration purposes.
    ///
    /// ```no_run
    /// use kernel::{bindings, c_str, platform, of, device::Core};
    /// use kernel::{
    ///     bindings,
    ///     device::Core,
    ///     of,
    ///     platform,
    /// };
    /// struct SampleDriver;
    ///
    /// impl platform::Driver for SampleDriver {
@@ -172,7 +181,7 @@ impl<const SIZE: usize> ExclusiveIoMem<SIZE> {
    fn ioremap(resource: &Resource) -> Result<Self> {
        let start = resource.start();
        let size = resource.size();
        let name = resource.name().unwrap_or(c_str!(""));
        let name = resource.name().unwrap_or_default();

        let region = resource
            .request_region(