summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2025-12-22 13:20:05 +0100
committerDanilo Krummrich <dakr@kernel.org>2025-12-22 17:56:04 +0100
commitee47c0ab23a041e0a34848488dee1a23c0940f21 (patch)
tree0c73c9e74e761534dfb9c0dd4392456d2b9a647e /drivers/gpu
parent97cf6bc0abd381fd84e5d8e978322a62a58fb00e (diff)
downloadlinux-next-ee47c0ab23a041e0a34848488dee1a23c0940f21.tar.gz
linux-next-ee47c0ab23a041e0a34848488dee1a23c0940f21.zip
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nova/driver.rs18
-rw-r--r--drivers/gpu/nova-core/driver.rs5
2 files changed, 15 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nova/driver.rs b/drivers/gpu/drm/nova/driver.rs
index 2246d8e104e0..b1af0a099551 100644
--- a/drivers/gpu/drm/nova/driver.rs
+++ b/drivers/gpu/drm/nova/driver.rs
@@ -1,7 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
use kernel::{
- auxiliary, c_str, device::Core, drm, drm::gem, drm::ioctl, prelude::*, sync::aref::ARef,
+ auxiliary,
+ device::Core,
+ drm::{
+ self,
+ gem,
+ ioctl, //
+ },
+ prelude::*,
+ sync::aref::ARef, //
};
use crate::file::File;
@@ -24,12 +32,12 @@ const INFO: drm::DriverInfo = drm::DriverInfo {
major: 0,
minor: 0,
patchlevel: 0,
- name: c_str!("nova"),
- desc: c_str!("Nvidia Graphics"),
+ name: c"nova",
+ desc: c"Nvidia Graphics",
};
-const NOVA_CORE_MODULE_NAME: &CStr = c_str!("NovaCore");
-const AUXILIARY_NAME: &CStr = c_str!("nova-drm");
+const NOVA_CORE_MODULE_NAME: &CStr = c"NovaCore";
+const AUXILIARY_NAME: &CStr = c"nova-drm";
kernel::auxiliary_device_table!(
AUX_TABLE,
diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
index b8b0cc0f2d93..5a4cc047bcfc 100644
--- a/drivers/gpu/nova-core/driver.rs
+++ b/drivers/gpu/nova-core/driver.rs
@@ -2,7 +2,6 @@
use kernel::{
auxiliary,
- c_str,
device::Core,
devres::Devres,
dma::Device,
@@ -82,7 +81,7 @@ impl pci::Driver for NovaCore {
unsafe { pdev.dma_set_mask_and_coherent(DmaMask::new::<GPU_DMA_BITS>())? };
let bar = Arc::pin_init(
- pdev.iomap_region_sized::<BAR0_SIZE>(0, c_str!("nova-core/bar0")),
+ pdev.iomap_region_sized::<BAR0_SIZE>(0, c"nova-core/bar0"),
GFP_KERNEL,
)?;
@@ -90,7 +89,7 @@ impl pci::Driver for NovaCore {
gpu <- Gpu::new(pdev, bar.clone(), bar.access(pdev.as_ref())?),
_reg <- auxiliary::Registration::new(
pdev.as_ref(),
- c_str!("nova-drm"),
+ c"nova-drm",
0, // TODO[XARR]: Once it lands, use XArray; for now we don't use the ID.
crate::MODULE_NAME
),