Re: [PATCH v3 7/8] gpu: nova-core: use core library's CStr instead of kernel one
From: Danilo Krummrich
Date: Tue Feb 17 2026 - 06:27:47 EST
On Tue Feb 17, 2026 at 3:45 AM CET, Alexandre Courbot wrote:
> The kernel's own CStr type has been replaced by the one in the core
> library, and is now an alias to the latter. Change our imports to
> directly reference the actual type.
>
> Reviewed-by: Lyude Paul <lyude@xxxxxxxxxx>
> Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/firmware.rs | 2 +-
> drivers/gpu/nova-core/firmware/gsp.rs | 6 +++++-
> drivers/gpu/nova-core/nova_core.rs | 2 +-
> 3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/firmware.rs b/drivers/gpu/nova-core/firmware.rs
> index 68779540aa28..2f7249383e51 100644
> --- a/drivers/gpu/nova-core/firmware.rs
> +++ b/drivers/gpu/nova-core/firmware.rs
> @@ -424,7 +424,7 @@ const fn make_entry_chipset(self, chipset: &str) -> Self {
> }
>
> pub(crate) const fn create(
> - module_name: &'static kernel::str::CStr,
> + module_name: &'static core::ffi::CStr,
> ) -> firmware::ModInfoBuilder<N> {
> let mut this = Self(firmware::ModInfoBuilder::new(module_name));
> let mut i = 0;
> diff --git a/drivers/gpu/nova-core/firmware/gsp.rs b/drivers/gpu/nova-core/firmware/gsp.rs
> index 9488a626352f..ae3f6581c5b6 100644
> --- a/drivers/gpu/nova-core/firmware/gsp.rs
> +++ b/drivers/gpu/nova-core/firmware/gsp.rs
> @@ -32,9 +32,13 @@
> /// that scheme before nova-core becomes stable, which means this module will eventually be
> /// removed.
> mod elf {
> + use core::{
> + ffi::CStr,
> + mem::size_of, //
> + };
> +
> use kernel::{
> bindings,
> - prelude::*,
> transmute::FromBytes, //
> };
What's the improvement in this change? Both of the ones factored out are already
correctly imported through prelude. Let's keep it as is.
> diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/nova_core.rs
> index c1121e7c64c5..b5caf1044697 100644
> --- a/drivers/gpu/nova-core/nova_core.rs
> +++ b/drivers/gpu/nova-core/nova_core.rs
> @@ -18,7 +18,7 @@
> mod sbuffer;
> mod vbios;
>
> -pub(crate) const MODULE_NAME: &kernel::str::CStr = <LocalModule as kernel::ModuleMetadata>::NAME;
> +pub(crate) const MODULE_NAME: &core::ffi::CStr = <LocalModule as kernel::ModuleMetadata>::NAME;
>
> kernel::module_pci_driver! {
> type: driver::NovaCore,
>
> --
> 2.53.0