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@redhat.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
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, //
};
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
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@redhat.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
> 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
On Tue Feb 17, 2026 at 8:25 PM JST, Danilo Krummrich wrote:
> 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@redhat.com>
>> Reviewed-by: Gary Guo <gary@garyguo.net>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> ---
>> 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.
Mmm, either they weren't at the time I initially wrote this patch, or
I've been careless (the latter being more likely). I'll remove this.
© 2016 - 2026 Red Hat, Inc.