* [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings
@ 2025-12-22 12:27 Tamir Duberstein
2025-12-22 14:18 ` Daniel Almeida
2025-12-22 17:03 ` Danilo Krummrich
0 siblings, 2 replies; 5+ messages in thread
From: Tamir Duberstein @ 2025-12-22 12:27 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross
Cc: dri-devel, linux-kernel, rust-for-linux, Tamir Duberstein
From: Tamir Duberstein <tamird@gmail.com>
C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible.
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
drivers/gpu/drm/tyr/driver.rs | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index 0389c558c036..65405f365fec 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0 or MIT
-use kernel::c_str;
use kernel::clk::Clk;
use kernel::clk::OptionalClk;
use kernel::device::Bound;
@@ -91,8 +90,8 @@ fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
MODULE_OF_TABLE,
<TyrDriver as platform::Driver>::IdInfo,
[
- (of::DeviceId::new(c_str!("rockchip,rk3588-mali")), ()),
- (of::DeviceId::new(c_str!("arm,mali-valhall-csf")), ())
+ (of::DeviceId::new(c"rockchip,rk3588-mali"), ()),
+ (of::DeviceId::new(c"arm,mali-valhall-csf"), ())
]
);
@@ -104,16 +103,16 @@ fn probe(
pdev: &platform::Device<Core>,
_info: Option<&Self::IdInfo>,
) -> impl PinInit<Self, Error> {
- let core_clk = Clk::get(pdev.as_ref(), Some(c_str!("core")))?;
- let stacks_clk = OptionalClk::get(pdev.as_ref(), Some(c_str!("stacks")))?;
- let coregroup_clk = OptionalClk::get(pdev.as_ref(), Some(c_str!("coregroup")))?;
+ let core_clk = Clk::get(pdev.as_ref(), Some(c"core"))?;
+ let stacks_clk = OptionalClk::get(pdev.as_ref(), Some(c"stacks"))?;
+ let coregroup_clk = OptionalClk::get(pdev.as_ref(), Some(c"coregroup"))?;
core_clk.prepare_enable()?;
stacks_clk.prepare_enable()?;
coregroup_clk.prepare_enable()?;
- let mali_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c_str!("mali"))?;
- let sram_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c_str!("sram"))?;
+ let mali_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"mali")?;
+ let sram_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"sram")?;
let request = pdev.io_request_by_index(0).ok_or(ENODEV)?;
let iomem = Arc::pin_init(request.iomap_sized::<SZ_2M>(), GFP_KERNEL)?;
@@ -174,8 +173,8 @@ fn drop(self: Pin<&mut Self>) {
major: 1,
minor: 5,
patchlevel: 0,
- name: c_str!("panthor"),
- desc: c_str!("ARM Mali Tyr DRM driver"),
+ name: c"panthor",
+ desc: c"ARM Mali Tyr DRM driver",
};
#[vtable]
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-tyr-37ee95790f5f
Best regards,
--
Tamir Duberstein <tamird@gmail.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings
2025-12-22 12:27 [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings Tamir Duberstein
@ 2025-12-22 14:18 ` Daniel Almeida
2025-12-23 7:48 ` Tamir Duberstein
2025-12-22 17:03 ` Danilo Krummrich
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Almeida @ 2025-12-22 14:18 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Danilo Krummrich, Alice Ryhl, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, dri-devel, linux-kernel,
rust-for-linux, Tamir Duberstein
Hi Tamir,
Please cc me for any Tyr changes.
> On 22 Dec 2025, at 09:27, Tamir Duberstein <tamird@kernel.org> wrote:
>
> From: Tamir Duberstein <tamird@gmail.com>
>
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
> drivers/gpu/drm/tyr/driver.rs | 19 +++++++++----------
> 1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> index 0389c558c036..65405f365fec 100644
> --- a/drivers/gpu/drm/tyr/driver.rs
> +++ b/drivers/gpu/drm/tyr/driver.rs
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0 or MIT
>
> -use kernel::c_str;
> use kernel::clk::Clk;
> use kernel::clk::OptionalClk;
> use kernel::device::Bound;
> @@ -91,8 +90,8 @@ fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
> MODULE_OF_TABLE,
> <TyrDriver as platform::Driver>::IdInfo,
> [
> - (of::DeviceId::new(c_str!("rockchip,rk3588-mali")), ()),
> - (of::DeviceId::new(c_str!("arm,mali-valhall-csf")), ())
> + (of::DeviceId::new(c"rockchip,rk3588-mali"), ()),
> + (of::DeviceId::new(c"arm,mali-valhall-csf"), ())
> ]
> );
>
> @@ -104,16 +103,16 @@ fn probe(
> pdev: &platform::Device<Core>,
> _info: Option<&Self::IdInfo>,
> ) -> impl PinInit<Self, Error> {
> - let core_clk = Clk::get(pdev.as_ref(), Some(c_str!("core")))?;
> - let stacks_clk = OptionalClk::get(pdev.as_ref(), Some(c_str!("stacks")))?;
> - let coregroup_clk = OptionalClk::get(pdev.as_ref(), Some(c_str!("coregroup")))?;
> + let core_clk = Clk::get(pdev.as_ref(), Some(c"core"))?;
> + let stacks_clk = OptionalClk::get(pdev.as_ref(), Some(c"stacks"))?;
> + let coregroup_clk = OptionalClk::get(pdev.as_ref(), Some(c"coregroup"))?;
>
> core_clk.prepare_enable()?;
> stacks_clk.prepare_enable()?;
> coregroup_clk.prepare_enable()?;
>
> - let mali_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c_str!("mali"))?;
> - let sram_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c_str!("sram"))?;
> + let mali_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"mali")?;
> + let sram_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"sram")?;
>
> let request = pdev.io_request_by_index(0).ok_or(ENODEV)?;
> let iomem = Arc::pin_init(request.iomap_sized::<SZ_2M>(), GFP_KERNEL)?;
> @@ -174,8 +173,8 @@ fn drop(self: Pin<&mut Self>) {
> major: 1,
> minor: 5,
> patchlevel: 0,
> - name: c_str!("panthor"),
> - desc: c_str!("ARM Mali Tyr DRM driver"),
> + name: c"panthor",
> + desc: c"ARM Mali Tyr DRM driver",
> };
>
> #[vtable]
>
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cstr-tyr-37ee95790f5f
>
> Best regards,
> --
> Tamir Duberstein <tamird@gmail.com>
>
>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings
2025-12-22 14:18 ` Daniel Almeida
@ 2025-12-23 7:48 ` Tamir Duberstein
2025-12-23 11:51 ` Danilo Krummrich
0 siblings, 1 reply; 5+ messages in thread
From: Tamir Duberstein @ 2025-12-23 7:48 UTC (permalink / raw)
To: Daniel Almeida
Cc: Danilo Krummrich, Alice Ryhl, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, dri-devel, linux-kernel,
rust-for-linux
On Mon, Dec 22, 2025 at 3:18 PM Daniel Almeida
<daniel.almeida@collabora.com> wrote:
>
> Hi Tamir,
>
> Please cc me for any Tyr changes.
Hey Daniel, thanks for the reviews! Looks like `drivers/gpu/drm/tyr/`
is listed in MAINTAINERS twice since commit 29e7c311b ("MAINTAINERS:
add Tyr to DRM DRIVERS AND COMMON INFRASTRUCTURE [RUST]") with
different sets of owners; it must be the case that last one wins in
b4. @Danilo is the overlap between the entries intended?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings
2025-12-23 7:48 ` Tamir Duberstein
@ 2025-12-23 11:51 ` Danilo Krummrich
0 siblings, 0 replies; 5+ messages in thread
From: Danilo Krummrich @ 2025-12-23 11:51 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Daniel Almeida, Alice Ryhl, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, dri-devel, linux-kernel,
rust-for-linux
On Tue Dec 23, 2025 at 8:48 AM CET, Tamir Duberstein wrote:
> @Danilo is the overlap between the entries intended?
Yes, the overlap is intended. In DRM we have a common tree for Rust
infrastructure and Rust drivers. Therefore one entry refects the maintainers of
the driver, the other entry reflects the maintainers of the tree the driver
patches flow through.
In terms of scripts/get_maintainer.pl not picking up the TYR entry, but only the
DRM RUST entry, I had a quick look and found a typo in the entry which does
prevent scripts/get_maintainer.pl to pick it up.
I will send a fix for this.
--
diff --git a/MAINTAINERS b/MAINTAINERS
index 5b11839cba9d..fe1e8da6c2bb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2158,7 +2158,7 @@ M: Alice Ryhl <aliceryhl@google.com>
L: dri-devel@lists.freedesktop.org
S: Supported
W: https://rust-for-linux.com/tyr-gpu-driver
-W https://drm.pages.freedesktop.org/maintainer-tools/drm-rust.html
+W: https://drm.pages.freedesktop.org/maintainer-tools/drm-rust.html
B: https://gitlab.freedesktop.org/panfrost/linux/-/issues
T: git https://gitlab.freedesktop.org/drm/rust/kernel.git
F: Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings
2025-12-22 12:27 [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings Tamir Duberstein
2025-12-22 14:18 ` Daniel Almeida
@ 2025-12-22 17:03 ` Danilo Krummrich
1 sibling, 0 replies; 5+ messages in thread
From: Danilo Krummrich @ 2025-12-22 17:03 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Alice Ryhl, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, dri-devel, linux-kernel, rust-for-linux,
Tamir Duberstein
On Mon Dec 22, 2025 at 1:27 PM CET, Tamir Duberstein wrote:
> From: Tamir Duberstein <tamird@gmail.com>
>
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Applied to drm-rust-next, thanks!
[ Change commit subject prefix to 'drm: tyr:'. - Danilo ]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-12-23 11:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 12:27 [PATCH] rust: drm: replace `kernel::c_str!` with C-Strings Tamir Duberstein
2025-12-22 14:18 ` Daniel Almeida
2025-12-23 7:48 ` Tamir Duberstein
2025-12-23 11:51 ` Danilo Krummrich
2025-12-22 17:03 ` Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox