| Message ID | 20251222-cstr-pwm-v1-1-e8916d976f8d@gmail.com |
|---|---|
| State | Accepted |
| Delegated to: | Uwe Kleine-König |
| Headers | show |
| Series | drivers: pwm: replace `kernel::c_str!` with C-Strings | expand |
> On 22 Dec 2025, at 09:24, 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/pwm/pwm_th1520.rs | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs > index e3b7e77356fc..8ae8f852ec02 100644 > --- a/drivers/pwm/pwm_th1520.rs > +++ b/drivers/pwm/pwm_th1520.rs > @@ -22,7 +22,6 @@ > > use core::ops::Deref; > use kernel::{ > - c_str, > clk::Clk, > device::{Bound, Core, Device}, > devres, > @@ -327,7 +326,7 @@ fn drop(self: Pin<&mut Self>) { > OF_TABLE, > MODULE_OF_TABLE, > <Th1520PwmPlatformDriver as platform::Driver>::IdInfo, > - [(of::DeviceId::new(c_str!("thead,th1520-pwm")), ())] > + [(of::DeviceId::new(c"thead,th1520-pwm"), ())] > ); > > impl platform::Driver for Th1520PwmPlatformDriver { > > --- > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 > change-id: 20251222-cstr-pwm-c9b9a4701157 > > Best regards, > -- > Tamir Duberstein <tamird@gmail.com> > > Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
On Mon, Dec 22, 2025 at 7:24 AM 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/pwm/pwm_th1520.rs | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs > index e3b7e77356fc..8ae8f852ec02 100644 > --- a/drivers/pwm/pwm_th1520.rs > +++ b/drivers/pwm/pwm_th1520.rs > @@ -22,7 +22,6 @@ > > use core::ops::Deref; > use kernel::{ > - c_str, > clk::Clk, > device::{Bound, Core, Device}, > devres, > @@ -327,7 +326,7 @@ fn drop(self: Pin<&mut Self>) { > OF_TABLE, > MODULE_OF_TABLE, > <Th1520PwmPlatformDriver as platform::Driver>::IdInfo, > - [(of::DeviceId::new(c_str!("thead,th1520-pwm")), ())] > + [(of::DeviceId::new(c"thead,th1520-pwm"), ())] > ); > > impl platform::Driver for Th1520PwmPlatformDriver { > > --- > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 > change-id: 20251222-cstr-pwm-c9b9a4701157 > > Best regards, > -- > Tamir Duberstein <tamird@gmail.com> > @Uwe could you please have a look? Cheers. Tamir
On Sat, Jan 3, 2026 at 9:30 PM Tamir Duberstein <tamird@gmail.com> wrote: > > On Mon, Dec 22, 2025 at 7:24 AM 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/pwm/pwm_th1520.rs | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs > > index e3b7e77356fc..8ae8f852ec02 100644 > > --- a/drivers/pwm/pwm_th1520.rs > > +++ b/drivers/pwm/pwm_th1520.rs > > @@ -22,7 +22,6 @@ > > > > use core::ops::Deref; > > use kernel::{ > > - c_str, > > clk::Clk, > > device::{Bound, Core, Device}, > > devres, > > @@ -327,7 +326,7 @@ fn drop(self: Pin<&mut Self>) { > > OF_TABLE, > > MODULE_OF_TABLE, > > <Th1520PwmPlatformDriver as platform::Driver>::IdInfo, > > - [(of::DeviceId::new(c_str!("thead,th1520-pwm")), ())] > > + [(of::DeviceId::new(c"thead,th1520-pwm"), ())] > > ); > > > > impl platform::Driver for Th1520PwmPlatformDriver { > > > > --- > > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 > > change-id: 20251222-cstr-pwm-c9b9a4701157 > > > > Best regards, > > -- > > Tamir Duberstein <tamird@gmail.com> > > > > @Uwe could you please have a look? > > Cheers. > Tamir Drew, Guo, or Fu: could you please take this through your tree, or would you be OK with it going through rust-next?
Hello, On Sat, Jan 03, 2026 at 09:30:31PM -0500, Tamir Duberstein wrote: > On Mon, Dec 22, 2025 at 7:24 AM 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/pwm/pwm_th1520.rs | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs > > index e3b7e77356fc..8ae8f852ec02 100644 > > --- a/drivers/pwm/pwm_th1520.rs > > +++ b/drivers/pwm/pwm_th1520.rs > > @@ -22,7 +22,6 @@ > > > > use core::ops::Deref; > > use kernel::{ > > - c_str, > > clk::Clk, > > device::{Bound, Core, Device}, > > devres, > > @@ -327,7 +326,7 @@ fn drop(self: Pin<&mut Self>) { > > OF_TABLE, > > MODULE_OF_TABLE, > > <Th1520PwmPlatformDriver as platform::Driver>::IdInfo, > > - [(of::DeviceId::new(c_str!("thead,th1520-pwm")), ())] > > + [(of::DeviceId::new(c"thead,th1520-pwm"), ())] > > ); > > > > impl platform::Driver for Th1520PwmPlatformDriver { > > > > --- > > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 > > change-id: 20251222-cstr-pwm-c9b9a4701157 > > > > Best regards, > > -- > > Tamir Duberstein <tamird@gmail.com> > > > > @Uwe could you please have a look? I did, but given I'm more or less rust illiterate I would welcome feedback by Michal Wilczynski. I only now notice that he wasn't on Cc: up to now. Best regards Uwe
On Mon, Jan 19, 2026 at 5:53 PM Uwe Kleine-König <ukleinek@kernel.org> wrote: > > I did, but given I'm more or less rust illiterate I would welcome > feedback by Michal Wilczynski. I only now notice that he wasn't on Cc: > up to now. Thanks! In case it helps, for context, this is part of a long migration: https://github.com/Rust-for-Linux/linux/issues/1075 https://lore.kernel.org/all/20250704-core-cstr-prepare-v1-0-a91524037783@gmail.com/ (@Tamir: in the future, for patches like this, and especially since the patch was split from a series and was a multi-step/multi-cycle migration etc., it probably helps to give maintainers some context with Link: tags to the ones above). Cheers, Miguel
Hello, On Mon, Jan 19, 2026 at 07:01:33PM +0100, Miguel Ojeda wrote: > (@Tamir: in the future, for patches like this, and especially since > the patch was split from a series and was a multi-step/multi-cycle > migration etc., it probably helps to give maintainers some context > with Link: tags to the ones above). And ideally also point out dependencies explicitly (also if there are none). This gives a cosy feeling to your friendly but clueless maintainer :-) Best regards Uwe
On 1/19/26 17:53, Uwe Kleine-König wrote: > Hello, > > On Sat, Jan 03, 2026 at 09:30:31PM -0500, Tamir Duberstein wrote: >> On Mon, Dec 22, 2025 at 7:24 AM 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/pwm/pwm_th1520.rs | 3 +-- >>> 1 file changed, 1 insertion(+), 2 deletions(-) >>> >>> diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs >>> index e3b7e77356fc..8ae8f852ec02 100644 >>> --- a/drivers/pwm/pwm_th1520.rs >>> +++ b/drivers/pwm/pwm_th1520.rs >>> @@ -22,7 +22,6 @@ >>> >>> use core::ops::Deref; >>> use kernel::{ >>> - c_str, >>> clk::Clk, >>> device::{Bound, Core, Device}, >>> devres, >>> @@ -327,7 +326,7 @@ fn drop(self: Pin<&mut Self>) { >>> OF_TABLE, >>> MODULE_OF_TABLE, >>> <Th1520PwmPlatformDriver as platform::Driver>::IdInfo, >>> - [(of::DeviceId::new(c_str!("thead,th1520-pwm")), ())] >>> + [(of::DeviceId::new(c"thead,th1520-pwm"), ())] >>> ); >>> >>> impl platform::Driver for Th1520PwmPlatformDriver { >>> >>> --- >>> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 >>> change-id: 20251222-cstr-pwm-c9b9a4701157 >>> >>> Best regards, >>> -- >>> Tamir Duberstein <tamird@gmail.com> >>> >> >> @Uwe could you please have a look? > > I did, but given I'm more or less rust illiterate I would welcome > feedback by Michal Wilczynski. I only now notice that he wasn't on Cc: > up to now. > > Best regards > Uwe I think the patch is correct. Thanks ! Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com>
Hello, On Mon, Dec 22, 2025 at 01:24:46PM +0100, 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 https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next as merge window material with the R-b tags by Michal Wilczynski and Daniel Almeida. (Side note, b4 told me: ✗ No key: openssh/tamird@gmail.com . It's not clear to me how to verify this signature. My experiments include: $ b4 kr --show-keys 20251222-cstr-pwm-v1-1-e8916d976f8d@gmail.com --- No keys found in the thread. and looking at https://lore.kernel.org/linux-pwm/20251222-cstr-pwm-v1-1-e8916d976f8d@gmail.com/raw where I see X-Developer-Key: i=tamird@gmail.com; a=openssh; fpr=SHA256:264rPmnnrb+ERkS7DDS3tuwqcJss/zevJRzoylqMsbc which IIUC isn't enough to verify the next mail signed with the same key. Am I missing something? I very appreciate signing your work, but if there is no way for me (or anyone else) to verify it, there is no gain.) Thanks Uwe
On Tue, Jan 20, 2026 at 3:39 AM Uwe Kleine-König <ukleinek@kernel.org> wrote: > > Hello, > > On Mon, Dec 22, 2025 at 01:24:46PM +0100, 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 > > https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next > > as merge window material with the R-b tags by Michal Wilczynski and > Daniel Almeida. > > (Side note, b4 told me: > > ✗ No key: openssh/tamird@gmail.com > > . It's not clear to me how to verify this signature. My experiments > include: > > $ b4 kr --show-keys 20251222-cstr-pwm-v1-1-e8916d976f8d@gmail.com > --- > No keys found in the thread. > > and looking at > https://lore.kernel.org/linux-pwm/20251222-cstr-pwm-v1-1-e8916d976f8d@gmail.com/raw > where I see > > X-Developer-Key: i=tamird@gmail.com; a=openssh; fpr=SHA256:264rPmnnrb+ERkS7DDS3tuwqcJss/zevJRzoylqMsbc > > which IIUC isn't enough to verify the next mail signed with the same > key. Am I missing something? I very appreciate signing your work, but if > there is no way for me (or anyone else) to verify it, there is no gain.) Yep, you are right to call this out. My usual setup uses SSH keys for commit signing, which are not part of the kernel web of trust. I promise to start signing kernel work with my GPG key soon :) In the meantime if you trust Github you can verify my signature against https://github.com/tamird.keys. Cheers. Tamir
On Tue, Jan 20, 2026 at 11:15:56AM -0500, Tamir Duberstein wrote: > On Tue, Jan 20, 2026 at 3:39 AM Uwe Kleine-König <ukleinek@kernel.org> wrote: > > (Side note, b4 told me: > > > > ✗ No key: openssh/tamird@gmail.com > > > > . It's not clear to me how to verify this signature. My experiments > > include: > > > > $ b4 kr --show-keys 20251222-cstr-pwm-v1-1-e8916d976f8d@gmail.com > > --- > > No keys found in the thread. > > > > and looking at > > https://lore.kernel.org/linux-pwm/20251222-cstr-pwm-v1-1-e8916d976f8d@gmail.com/raw > > where I see > > > > X-Developer-Key: i=tamird@gmail.com; a=openssh; fpr=SHA256:264rPmnnrb+ERkS7DDS3tuwqcJss/zevJRzoylqMsbc > > > > which IIUC isn't enough to verify the next mail signed with the same > > key. Am I missing something? I very appreciate signing your work, but if > > there is no way for me (or anyone else) to verify it, there is no gain.) > > Yep, you are right to call this out. My usual setup uses SSH keys for > commit signing, which are not part of the kernel web of trust. I > promise to start signing kernel work with my GPG key soon :) While I notice that the trend goes to using ssh-keys, I still prefer OpenPGP. So +1 on your plan. > In the meantime if you trust Github you can verify my signature > against https://github.com/tamird.keys. OK, for the record: $ curl --create-dirs -o ~/.local/share/b4/keyring/openssh/gmail.com/tamird/default https://github.com/tamird.keys makes `b4 am CAJ-ks9=USrGECVS1qMqs+iCKUqvOdfcjA6phAjaF0wfcTkQt_g@mail.gmail.com` emit: ✓ Signed: openssh/tamird@gmail.com (From: tamird@kernel.org) This looks a bit strange (because there is gmail and kernel.org), but better than before. Best regards Uwe
diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs index e3b7e77356fc..8ae8f852ec02 100644 --- a/drivers/pwm/pwm_th1520.rs +++ b/drivers/pwm/pwm_th1520.rs @@ -22,7 +22,6 @@ use core::ops::Deref; use kernel::{ - c_str, clk::Clk, device::{Bound, Core, Device}, devres, @@ -327,7 +326,7 @@ fn drop(self: Pin<&mut Self>) { OF_TABLE, MODULE_OF_TABLE, <Th1520PwmPlatformDriver as platform::Driver>::IdInfo, - [(of::DeviceId::new(c_str!("thead,th1520-pwm")), ())] + [(of::DeviceId::new(c"thead,th1520-pwm"), ())] ); impl platform::Driver for Th1520PwmPlatformDriver {