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.

gpu: nova: 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.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://patch.msgid.link/20251222-cstr-nova-v1-1-0e2353d5debe@gmail.com
[ Use 'nova' commit subject prefix; use kernel vertical import style.
- Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Tamir Duberstein and committed by
Danilo Krummrich
ee47c0ab 97cf6bc0

+15 -8
+13 -5
drivers/gpu/drm/nova/driver.rs
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 3 use kernel::{ 4 - auxiliary, c_str, device::Core, drm, drm::gem, drm::ioctl, prelude::*, sync::aref::ARef, 4 + auxiliary, 5 + device::Core, 6 + drm::{ 7 + self, 8 + gem, 9 + ioctl, // 10 + }, 11 + prelude::*, 12 + sync::aref::ARef, // 5 13 }; 6 14 7 15 use crate::file::File; ··· 32 24 major: 0, 33 25 minor: 0, 34 26 patchlevel: 0, 35 - name: c_str!("nova"), 36 - desc: c_str!("Nvidia Graphics"), 27 + name: c"nova", 28 + desc: c"Nvidia Graphics", 37 29 }; 38 30 39 - const NOVA_CORE_MODULE_NAME: &CStr = c_str!("NovaCore"); 40 - const AUXILIARY_NAME: &CStr = c_str!("nova-drm"); 31 + const NOVA_CORE_MODULE_NAME: &CStr = c"NovaCore"; 32 + const AUXILIARY_NAME: &CStr = c"nova-drm"; 41 33 42 34 kernel::auxiliary_device_table!( 43 35 AUX_TABLE,
+2 -3
drivers/gpu/nova-core/driver.rs
··· 2 2 3 3 use kernel::{ 4 4 auxiliary, 5 - c_str, 6 5 device::Core, 7 6 devres::Devres, 8 7 dma::Device, ··· 81 82 unsafe { pdev.dma_set_mask_and_coherent(DmaMask::new::<GPU_DMA_BITS>())? }; 82 83 83 84 let bar = Arc::pin_init( 84 - pdev.iomap_region_sized::<BAR0_SIZE>(0, c_str!("nova-core/bar0")), 85 + pdev.iomap_region_sized::<BAR0_SIZE>(0, c"nova-core/bar0"), 85 86 GFP_KERNEL, 86 87 )?; 87 88 ··· 89 90 gpu <- Gpu::new(pdev, bar.clone(), bar.access(pdev.as_ref())?), 90 91 _reg <- auxiliary::Registration::new( 91 92 pdev.as_ref(), 92 - c_str!("nova-drm"), 93 + c"nova-drm", 93 94 0, // TODO[XARR]: Once it lands, use XArray; for now we don't use the ID. 94 95 crate::MODULE_NAME 95 96 ),