Clean up references to `kernel::str::CStr`.
Signed-off-by: Tamir Duberstein
---
drivers/gpu/drm/drm_panic_qr.rs | 3 ++-
drivers/gpu/nova-core/firmware.rs | 2 +-
drivers/gpu/nova-core/nova_core.rs| 2 +-
drivers/net/phy/ax88796b_rust.rs | 1 +
drivers/net/phy/qt2025.rs
inux/linux/issues/1075
Signed-off-by: Tamir Duberstein
---
Changes in v12:
- Introduce `kernel::fmt::Display` to allow implementations on foreign
types.
- Tidy up doc comment on `str_to_cstr`. (Alice Ryhl).
- Link to v11:
https://lore.kernel.org/r/20250530-cstr-core-v11-0-cd9c0cbcb...@gmail.com
Chan
Signed-off-by: Tamir Duberstein
---
drivers/block/rnull.rs | 2 +-
drivers/gpu/nova-core/gpu.rs | 4 +-
rust/kernel/block/mq.rs | 2 +-
rust/kernel/device.rs| 2 +-
rust/kernel/fmt.rs | 89 +++
rust/kernel/kunit.rs | 6
nux/commit/faa3cbcca03d0dec8f8e43f1d8d5c0860d98a23f
[0]
Signed-off-by: Tamir Duberstein
---
drivers/gpu/drm/drm_panic_qr.rs | 2 +-
rust/kernel/auxiliary.rs| 4 +-
rust/kernel/configfs.rs | 4 +-
rust/kernel/cpufreq.rs | 2 +-
rust/kernel/device.rs | 4 +-
rust/
C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible and rename
`kernel::c_str!` to `str_to_cstr!` to clarify its intended use.
Closes: https://github.com/Rust-for-Linux/linux/issues/1075
Signed-off-by: Tamir Duberstein
Remove a handful of unncessary intermediate vectors and token streams;
mainly the top-level stream can be directly extended with the notable
exception of groups.
Remove an unnecessary `#[allow(dead_code)]` added in commit dbd5058ba60c
("rust: make pin-init its own crate").
Signed-off
On Wed, Jun 18, 2025 at 1:44 PM Danilo Krummrich wrote:
>
> On 6/18/25 6:45 PM, Miguel Ojeda wrote:
> > On Wed, Jun 18, 2025 at 3:54 PM Tamir Duberstein wrote:
> >>
> >> @Andreas Hindborg could you please have a look for configfs?
> >>
> >> @Rafae
On Wed, Jun 18, 2025 at 1:50 PM Miguel Ojeda
wrote:
>
> On Wed, Jun 18, 2025 at 7:38 PM Danilo Krummrich wrote:
> >
> > Shouldn't this be `c_long`?
>
> Yeah, agreed, it is clearer -- I mentioned that for similar ones in a
> previous version.
+1
Miguel, would you mind taking care of this on appl
On Sun, Jun 15, 2025 at 4:55 PM Tamir Duberstein wrote:
>
> In Rust 1.51.0, Clippy introduced the `ptr_as_ptr` lint [1]:
>
> > Though `as` casts between raw pointers are not terrible,
> > `pointer::cast` is safer because it cannot accidentally change the
> > pointer
On Sun, Jun 15, 2025 at 4:55 PM Tamir Duberstein wrote:
>
> Before Rust 1.29.0, Clippy introduced the `cast_lossless` lint [1]:
>
> > Rust’s `as` keyword will perform many kinds of conversions, including
> > silently lossy conversions. Conversion functions such as `i32
On Sun, Jun 15, 2025 at 4:55 PM Tamir Duberstein wrote:
>
> In Rust 1.63.0, Clippy introduced the `as_underscore` lint [1]:
>
> > The conversion might include lossy conversion or a dangerous cast that
> > might go undetected due to the type being inferred.
> >
> &g
To help catch this kind of mistake, add a new Opaque::from_raw that
> wraps a raw pointer in Opaque without changing the inner type.
>
> Signed-off-by: Alice Ryhl
Reviewed-by: Tamir Duberstein
> ---
> rust/kernel/drm/device.rs | 4 +---
> rust/kernel/drm/gem/mod.rs |
x27;t missed.
As a later addition, `clippy::cast_lossless` and `clippy::ref_as_ptr`
are also enabled.
Signed-off-by: Tamir Duberstein
---
Changes in v12:
- Remove stale mention of a dependency. (Miguel Ojeda)
- Apply to config, cpufreq, and nova. (Miguel Ojeda)
- Link to v11:
https://lore.kernel.
d8ortxsutkgl.1kojagbm8f...@proton.me/
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
drivers/gpu/drm/drm_panic_qr.rs | 4 ++--
drivers/gpu/nova-core/regs.rs| 2 +-
drivers/gpu/nova-core/regs/macros.rs | 2 +
iewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/configfs.rs | 20 ++--
rust/kernel/device_id.rs | 2 +-
rust/kernel/fs/file.rs | 2 +-
rust/kernel/str.rs | 4 ++
https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness [1]
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
rust/kernel/block/mq/request.rs | 4 ++--
rust/kernel/drm/device.rs | 4 ++--
3 fil
wed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/alloc/allocator_test.rs| 2 +-
rust/kernel/alloc/kvec.rs | 4 ++--
rust/kernel/configfs.rs| 2 +-
rust
us apply the
changes and enable the lint -- no functional change intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore
[1]
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
d
tml#as_ptr_cast_mut
[1]
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/devres.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 5eeddfbf5900..bb33023f87c3 100644
--- a/
On Fri, Jun 13, 2025 at 2:14 PM Miguel Ojeda
wrote:
>
> On Wed, Jun 11, 2025 at 12:23 PM Tamir Duberstein wrote:
> >
> > This series depends on "rust: retain pointer mut-ness in
> > `container_of!`"[1].
>
> Not anymore! :)
>
> > Signed-off-by: Ta
tml#as_ptr_cast_mut
[1]
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/devres.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 5eeddfbf5900..bb33023f87c3 100644
--- a/
us apply the
changes and enable the lint -- no functional change intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore
[1]
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
iewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/device_id.rs | 2 +-
rust/kernel/fs/file.rs | 2 +-
rust/kernel/str.rs | 4 ++--
rust/kernel/uaccess.rs | 4 ++--
rust/uap
wed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/alloc/allocator_test.rs| 2 +-
rust/kernel/alloc/kvec.rs | 4 ++--
rust/kernel/device.rs | 4 ++--
rus
d8ortxsutkgl.1kojagbm8f...@proton.me/
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
drivers/gpu/drm/drm_panic_qr.rs | 4 ++--
rust/bindings/lib.rs| 1 +
rust/kernel/net/phy.rs | 4 ++--
rust/uapi/lib.rs
https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness [1]
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
rust/kernel/block/mq/request.rs | 4 ++--
rust/kernel/drm/device.rs | 4 ++--
3 fil
- Added additional patches, converted to series.
- Link to v1:
https://lore.kernel.org/r/20250307-ptr-as-ptr-v1-1-582d06514...@gmail.com
---
Tamir Duberstein (6):
rust: enable `clippy::ptr_as_ptr` lint
rust: enable `clippy::ptr_cast_constness` lint
rust: enable `clippy::as_ptr_c
On Sun, Jun 8, 2025 at 5:06 PM Miguel Ojeda
wrote:
>
> On Fri, Apr 18, 2025 at 5:37 PM Tamir Duberstein wrote:
> >
> > -bindings::BLK_STS_OK as _
> > +bindings::BLK_STS_OK as u8
>
> > -unsafe { bindings::blk_mq_end_request(request_
On Mon, Jun 2, 2025 at 4:45 AM Alice Ryhl wrote:
>
> On Fri, May 30, 2025 at 08:27:45AM -0400, Tamir Duberstein wrote:
> > C-String literals were added in Rust 1.77. Replace instances of
> > `kernel::c_str!` with C-String literals where possible and rename
> > `kernel:
On Mon, Jun 2, 2025 at 4:46 AM Alice Ryhl wrote:
>
> On Fri, May 30, 2025 at 08:27:44AM -0400, Tamir Duberstein wrote:
> > `kernel::ffi::CStr` was introduced in commit d126d2380131 ("rust: str:
> > add `CStr` type") in November 2022 as an upstreaming of earlier work
&
On Sun, Jun 1, 2025 at 12:24 PM Benno Lossin wrote:
>
> On Fri May 30, 2025 at 2:27 PM CEST, Tamir Duberstein wrote:
> > Remove a handful of unncessary intermediate vectors and token streams;
> > mainly the top-level stream can be directly extended with the notable
>
Clean up references to `kernel::str::CStr`.
Signed-off-by: Tamir Duberstein
---
drivers/gpu/drm/drm_panic_qr.rs | 3 ++-
drivers/gpu/nova-core/firmware.rs | 2 +-
drivers/net/phy/ax88796b_rust.rs | 1 +
drivers/net/phy/qt2025.rs | 1 +
rust/kernel/device.rs | 3
nux/commit/faa3cbcca03d0dec8f8e43f1d8d5c0860d98a23f
[0]
Signed-off-by: Tamir Duberstein
---
drivers/gpu/drm/drm_panic_qr.rs | 2 +-
rust/kernel/device.rs | 4 +-
rust/kernel/error.rs| 4 +-
rust/kernel/firmware.rs | 11 +-
rust/kernel/kunit.rs| 6 +-
r
Remove a handful of unncessary intermediate vectors and token streams;
mainly the top-level stream can be directly extended with the notable
exception of groups.
Remove an unnecessary `#[allow(dead_code)]` added in commit dbd5058ba60c
("rust: make pin-init its own crate").
Signed-off
C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible and rename
`kernel::c_str!` to `str_to_cstr!` to clarify its intended use.
Closes: https://github.com/Rust-for-Linux/linux/issues/1075
Signed-off-by: Tamir Duberstein
/516476467
Signed-off-by: Tamir Duberstein
---
drivers/block/rnull.rs | 2 +-
rust/kernel/block/mq.rs | 2 +-
rust/kernel/device.rs | 2 +-
rust/kernel/fmt.rs | 77 +++
rust/kernel/kunit.rs| 6 +--
rust/kernel/lib.rs | 1 +
r
inux/linux/issues/1075
Signed-off-by: Tamir Duberstein
---
Changes in v11:
- Use `quote_spanned!` to avoid `use<'a, T>` and generally reduce manual
token construction.
- Add a commit to simplify `quote_spanned!`.
- Drop first commit in favor of
https://lore.kernel.org/rust-for-linux/202
On Wed, May 28, 2025 at 11:35 AM Benno Lossin wrote:
>
> On Wed May 28, 2025 at 12:36 PM CEST, Alice Ryhl wrote:
> > On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote:
> >> On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote:
> >> >
> >&
On Tue, May 27, 2025 at 4:49 PM Benno Lossin wrote:
>
> On Tue May 27, 2025 at 5:02 PM CEST, Tamir Duberstein wrote:
> > On Mon, May 26, 2025 at 7:01 PM Benno Lossin wrote:
> >> On Tue May 27, 2025 at 12:17 AM CEST, Tamir Duberstein wrote:
> >> > On Mon, May
On Wed, May 28, 2025 at 6:38 AM Alice Ryhl wrote:
>
> On Sat, May 24, 2025 at 04:33:00PM -0400, Tamir Duberstein wrote:
> > This picks up from Michal Rostecki's work[0]. Per Michal's guidance I
> > have omitted Co-authored tags, as the end result is quite differe
On Mon, May 26, 2025 at 7:07 PM Benno Lossin wrote:
>
> On Tue May 27, 2025 at 12:29 AM CEST, Tamir Duberstein wrote:
> > On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote:
> >> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> >> > +
On Mon, May 26, 2025 at 7:03 PM Benno Lossin wrote:
>
> On Tue May 27, 2025 at 12:24 AM CEST, Tamir Duberstein wrote:
> > On Mon, May 26, 2025 at 10:56 AM Benno Lossin wrote:
> >>
> >> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> >> >
On Mon, May 26, 2025 at 7:01 PM Benno Lossin wrote:
>
> On Tue May 27, 2025 at 12:17 AM CEST, Tamir Duberstein wrote:
> > On Mon, May 26, 2025 at 10:48 AM Benno Lossin wrote:
> >> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> >> > Introdu
On Tue, May 27, 2025 at 8:44 AM Alice Ryhl wrote:
>
> On Tue, May 27, 2025 at 12:18 AM Tamir Duberstein wrote:
> > > > +}
> > > > +
> > > > +fn make_ident<'a, T: IntoIterator>(
> > > > +span: Span,
> > > > +name
On Mon, May 26, 2025 at 11:05 AM Benno Lossin wrote:
>
> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> > Clean up references to `kernel::str::CStr`.
> >
> > Signed-off-by: Tamir Duberstein
> > ---
> > drivers/gpu/drm/drm_panic_qr.rs
On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote:
>
> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> > +macro_rules! c_str_avoid_literals {
>
> I don't like this name, how about `concat_to_c_str` or
> `concat_with_nul`?
>
> This macro also i
On Mon, May 26, 2025 at 10:56 AM Benno Lossin wrote:
>
> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> > `std::ffi::CStr` was moved to `core::ffi::CStr` in Rust 1.64. Replace
> > `kernel::str::CStr` with `core::ffi::CStr` now that we can.
>
> What'
On Mon, May 26, 2025 at 10:48 AM Benno Lossin wrote:
>
> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> > Introduce a `fmt!` macro which wraps all arguments in
> > `kernel::fmt::Adapter` This enables formatting of foreign types (like
> > `core::ffi::CStr
On Mon, May 26, 2025 at 12:15 PM Miguel Ojeda
wrote:
>
> On Sat, May 24, 2025 at 10:33 PM Tamir Duberstein wrote:
> >
> > This title is consistent with all other macros' documentation,
> > regardless of the number of examples contained in their "Examples&qu
C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible and rename
`kernel::c_str!` to `c_str_avoid_literals` to clarify its intended use.
Closes: https://github.com/Rust-for-Linux/linux/issues/1075
Signed-off-by: Tamir Duberstein
Clean up references to `kernel::str::CStr`.
Signed-off-by: Tamir Duberstein
---
drivers/gpu/drm/drm_panic_qr.rs | 3 ++-
drivers/gpu/nova-core/firmware.rs | 2 +-
drivers/net/phy/ax88796b_rust.rs | 1 +
drivers/net/phy/qt2025.rs | 1 +
rust/kernel/device.rs | 3
/516476467
Signed-off-by: Tamir Duberstein
---
drivers/block/rnull.rs | 2 +-
rust/kernel/block/mq.rs | 2 +-
rust/kernel/device.rs | 2 +-
rust/kernel/fmt.rs | 77 +
rust/kernel/kunit.rs| 6 +--
rust/kernel/lib.rs | 1 +
r
inux/linux/issues/1075
Signed-off-by: Tamir Duberstein
---
Changes in v10:
- Rebase on cbeaa41dfe26b72639141e87183cb23e00d4b0dd.
- Implement Alice's suggestion to use a proc macro to work around orphan
rules otherwise preventing `core::ffi::CStr` to be directly printed
with `{}`.
- Lin
necessary; the rest will be done in a later commit.
Signed-off-by: Tamir Duberstein
---
drivers/gpu/drm/drm_panic_qr.rs | 2 +-
rust/kernel/device.rs | 4 +-
rust/kernel/error.rs| 4 +-
rust/kernel/firmware.rs | 11 +-
rust/kernel/kunit.rs| 6 +-
rust
This title is consistent with all other macros' documentation,
regardless of the number of examples contained in their "Examples"
sections.
Signed-off-by: Tamir Duberstein
---
rust/macros/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/macros/lib.r
ast_constness [1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
rust/kernel/block/mq/request.rs | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 5d2931344490..7b85b2a8d371 100644
--- a/M
us apply the
changes and enable the lint -- no functional change intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore
[1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/block/mq/operati
tml#as_ptr_cast_mut
[1]
Reviewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/devres.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 7b85b2a8d371..04a5246171f9 100644
--- a/
wed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/alloc/allocator_test.rs| 2 +-
rust/kernel/alloc/kvec.rs | 4 ++--
rust/kernel/device.rs | 4 ++--
rus
iewed-by: Benno Lossin
Reviewed-by: Boqun Feng
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/device_id.rs | 2 +-
rust/kernel/fs/file.rs | 2 +-
rust/kernel/str.rs | 4 ++--
rust/kernel/uaccess.rs | 4 ++--
rust/uap
d8ortxsutkgl.1kojagbm8f...@proton.me/
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
drivers/gpu/drm/drm_panic_qr.rs | 2 +-
rust/bindings/lib.rs| 1 +
rust/kernel/net/phy.rs | 4 ++--
rust/uapi/lib.rs|
- Added additional patches, converted to series.
- Link to v1:
https://lore.kernel.org/r/20250307-ptr-as-ptr-v1-1-582d06514...@gmail.com
---
Tamir Duberstein (6):
rust: enable `clippy::ptr_as_ptr` lint
rust: enable `clippy::ptr_cast_constness` lint
rust: enable `clippy::as_ptr_c
On Fri, Apr 18, 2025 at 11:09 AM Boqun Feng wrote:
>
> On Fri, Apr 18, 2025 at 08:08:02AM -0400, Tamir Duberstein wrote:
> > On Thu, Apr 17, 2025 at 4:12 PM Boqun Feng wrote:
> > >
> > > On Thu, Apr 17, 2025 at 03:26:14PM
On Thu, Apr 17, 2025 at 4:12 PM Boqun Feng wrote:
>
> On Thu, Apr 17, 2025 at 03:26:14PM -0400, Tamir Duberstein wrote:
> [...]
> > >
> > > > Ok(())
> > > > }
> > > > diff --git a/rust/kernel/device_id.rs b/rust/kernel/device
On Thu, Apr 17, 2025 at 1:29 PM Boqun Feng wrote:
>
> On Wed, Apr 16, 2025 at 01:36:09PM -0400, Tamir Duberstein wrote:
> > Before Rust 1.29.0, Clippy introduced the `cast_lossless` lint [1]:
> >
> > > Rust’s `as` keyword will perform many kinds of conversions, inc
On Thu, Apr 17, 2025 at 1:55 PM Boqun Feng wrote:
>
> On Wed, Apr 16, 2025 at 01:36:08PM -0400, Tamir Duberstein wrote:
> > In Rust 1.63.0, Clippy introduced the `as_underscore` lint [1]:
> >
> > > The conversion might include lossy conversion or a dangerous cast tha
On Thu, Apr 17, 2025 at 1:12 PM Boqun Feng wrote:
>
> On Wed, Apr 16, 2025 at 01:36:06PM -0400, Tamir Duberstein wrote:
> > In Rust 1.72.0, Clippy introduced the `ptr_cast_constness` lint [1]:
> >
> > > Though `as` casts between raw pointers are not terrible,
&g
On Thu, Apr 17, 2025 at 12:48 PM Boqun Feng wrote:
>
> On Wed, Apr 16, 2025 at 01:36:05PM -0400, Tamir Duberstein wrote:
> > In Rust 1.51.0, Clippy introduced the `ptr_as_ptr` lint [1]:
> >
> > > Though `as` casts between raw pointers are not terrible,
> > >
On Wed, Apr 16, 2025 at 1:51 PM Boqun Feng wrote:
>
> On Wed, Apr 16, 2025 at 01:36:10PM -0400, Tamir Duberstein wrote:
> > In Rust 1.78.0, Clippy introduced the `ref_as_ptr` lint [1]:
> >
> > > Using `as` casts may result in silently changing mutability or type.
us apply the
changes and enable the lint -- no functional change intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore
[1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/block/mq/operati
` is replaced with `let *mut *const T = (*mut *mut
T)`.cast();` since pointer to pointer can be confusing.
Apply these changes and enable the lint -- no functional change
intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr [1]
Reviewed-by: Benno Lossin
Si
tml#as_ptr_cast_mut
[1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/devres.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 7b85b2a8d371..04a5246171f9 100644
--- a/Makefile
+++ b/Makefile
@@
d8ortxsutkgl.1kojagbm8f...@proton.me/
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
drivers/gpu/drm/drm_panic_qr.rs | 2 +-
rust/bindings/lib.rs| 1 +
rust/kernel/net/phy.rs | 4 ++--
rust/uapi/lib.rs|
iewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/device_id.rs | 2 +-
rust/kernel/fs/file.rs | 2 +-
rust/kernel/str.rs | 4 ++--
rust/kernel/uaccess.rs | 4 ++--
rust/uapi/lib.rs | 1 +
7 files ch
-id: 20250409-container-of-mutness-b153dab4388d:v1
prerequisite-patch-id: 53d5889db599267f87642bb0ae3063c29bc24863
Best regards,
--
Tamir Duberstein
ast_constness [1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
rust/kernel/block/mq/request.rs | 4 ++--
rust/kernel/dma.rs | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index
On Tue, Apr 15, 2025 at 7:03 PM Boqun Feng wrote:
>
> On Tue, Apr 15, 2025 at 04:59:01PM -0400, Tamir Duberstein wrote:
> [...]
> > > > > > > > diff --git a/rust/kernel/device_id.rs b/rust/kernel/device_id.rs
> > > > > > > > index 406
On Tue, Apr 15, 2025 at 4:51 PM Boqun Feng wrote:
>
> On Tue, Apr 15, 2025 at 04:10:01PM -0400, Tamir Duberstein wrote:
> > On Tue, Apr 15, 2025 at 2:18 PM Boqun Feng wrote:
> > >
> > > On Tue, Apr 15, 2025 at 01:58:41PM -0400, Tamir Duberstein wrote:
> > &g
On Tue, Apr 15, 2025 at 2:18 PM Boqun Feng wrote:
>
> On Tue, Apr 15, 2025 at 01:58:41PM -0400, Tamir Duberstein wrote:
> > Hi Boqun, thanks for having a look!
> >
> > On Tue, Apr 15, 2025 at 1:37 PM Boqun Feng wrote:
> > >
> > > On Wed, Apr 09, 2025 a
Hi Boqun, thanks for having a look!
On Tue, Apr 15, 2025 at 1:37 PM Boqun Feng wrote:
>
> On Wed, Apr 09, 2025 at 10:47:23AM -0400, Tamir Duberstein wrote:
> > In Rust 1.78.0, Clippy introduced the `ref_as_ptr` lint [1]:
> >
> > > Using `as` casts may result in sile
tml#as_ptr_cast_mut
[1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/devres.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 7b85b2a8d371..04a5246171f9 100644
--- a/Makefile
+++ b/Makefile
@@
d-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/bindings/lib.rs | 1 +
rust/kernel/device_id.rs | 3 ++-
rust/kernel/fs/file.rs | 3 ++-
rust/kernel/str.rs | 6 --
rust/kernel/uaccess.rs | 10 --
rust/uapi/lib.rs | 1 +
7 files cha
eries.
- Link to v1:
https://lore.kernel.org/r/20250307-ptr-as-ptr-v1-1-582d06514...@gmail.com
---
Tamir Duberstein (6):
rust: enable `clippy::ptr_as_ptr` lint
rust: enable `clippy::ptr_cast_constness` lint
rust: enable `clippy::as_ptr_cast_mut` lint
rust: enable `clippy::as_
d8ortxsutkgl.1kojagbm8f...@proton.me/
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
drivers/gpu/drm/drm_panic_qr.rs | 2 +-
rust/bindings/lib.rs| 1 +
rust/kernel/net/phy.rs | 4 ++--
rust/uapi/lib.rs|
us apply the
changes and enable the lint -- no functional change intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore
[1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/block/mq/operati
` is replaced with `let *mut *const T = (*mut *mut
T)`.cast();` since pointer to pointer can be confusing.
Apply these changes and enable the lint -- no functional change
intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr [1]
Reviewed-by: Benno Lossin
Si
er/index.html#ptr_cast_constness [1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
rust/kernel/block/mq/request.rs | 5 +++--
rust/kernel/dma.rs | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/M
Some(n) => self.extend_with(n, value, flags),
None => {
self.truncate(new_len);
Ok(())
}
}
> }
>
> impl Drop for Vec
> --
> 2.48.1
>
>
Either way:
Reviewed-by: Tamir Duberstein
On Thu, Mar 27, 2025 at 10:15 AM Tamir Duberstein wrote:
>
> On Wed, Mar 26, 2025 at 6:15 PM Benno Lossin wrote:
> >
> > On Wed Mar 26, 2025 at 11:09 PM CET, Tamir Duberstein wrote:
> > > On Wed, Mar 26, 2025 at 5:09 PM Benno Lossin
> > > wrote:
> > &g
On Wed, Mar 26, 2025 at 6:15 PM Benno Lossin wrote:
>
> On Wed Mar 26, 2025 at 11:09 PM CET, Tamir Duberstein wrote:
> > On Wed, Mar 26, 2025 at 5:09 PM Benno Lossin wrote:
> >> On Wed Mar 26, 2025 at 8:06 PM CET, Tamir Duberstein wrote:
> >> > On Wed, Mar
On Wed, Mar 26, 2025 at 5:09 PM Benno Lossin wrote:
>
> On Wed Mar 26, 2025 at 8:06 PM CET, Tamir Duberstein wrote:
> > On Wed, Mar 26, 2025 at 1:36 PM Benno Lossin wrote:
> >> On Wed Mar 26, 2025 at 5:57 PM CET, Tamir Duberstein wrote:
> >> > In the current co
On Wed, Mar 26, 2025 at 3:06 PM Tamir Duberstein wrote:
>
> On Wed, Mar 26, 2025 at 1:36 PM Benno Lossin wrote:
> >
> > On Wed Mar 26, 2025 at 5:57 PM CET, Tamir Duberstein wrote:
> > >
> > >
> > > In the current code you're looking at, yes. Bu
On Wed, Mar 26, 2025 at 1:36 PM Benno Lossin wrote:
>
> On Wed Mar 26, 2025 at 5:57 PM CET, Tamir Duberstein wrote:
> >
> >
> > In the current code you're looking at, yes. But in the code I have
> > locally I'm transmuting `[u8]` to `BStr`. See my earlier
On Wed, Mar 26, 2025 at 12:43 PM Benno Lossin wrote:
>
> On Wed Mar 26, 2025 at 11:35 AM CET, Tamir Duberstein wrote:
> > On Wed, Mar 26, 2025 at 6:31 AM Benno Lossin wrote:
> >> On Wed Mar 26, 2025 at 12:54 AM CET, Tamir Duberstein wrote:
> >> > On Tue, Mar
On Wed, Mar 26, 2025 at 6:31 AM Benno Lossin wrote:
>
> On Wed Mar 26, 2025 at 12:54 AM CET, Tamir Duberstein wrote:
> > On Tue, Mar 25, 2025 at 6:40 PM Benno Lossin wrote:
> >> On Tue Mar 25, 2025 at 11:33 PM CET, Tamir Duberstein wrote:
> >> > On Tue, Mar
On Tue, Mar 25, 2025 at 4:23 PM Miguel Ojeda
wrote:
>
> On Tue, Mar 25, 2025 at 9:07 PM Tamir Duberstein wrote:
> >
> > Changes in v7:
> > - Add patch to enable `clippy::ref_as_ptr`.
> > - Link to v6:
> > https://lore.kernel.org/r/20250324-ptr-as-ptr-v6-0-49
On Tue, Mar 25, 2025 at 6:40 PM Benno Lossin wrote:
>
> On Tue Mar 25, 2025 at 11:33 PM CET, Tamir Duberstein wrote:
> > On Tue, Mar 25, 2025 at 6:11 PM Benno Lossin wrote:
> >>
> >> On Tue Mar 25, 2025 at 9:07 PM CET, Tamir Duberstein wrote:
> >> > dif
On Tue, Mar 25, 2025 at 6:11 PM Benno Lossin wrote:
>
> On Tue Mar 25, 2025 at 9:07 PM CET, Tamir Duberstein wrote:
> > diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
> > index 40034f77fc2f..6233af50bab7 100644
> > --- a/rust/kernel/str.rs
> > +++ b/rust/ke
d8ortxsutkgl.1kojagbm8f...@proton.me/
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile| 1 +
drivers/gpu/drm/drm_panic_qr.rs | 10 +-
rust/bindings/lib.rs| 1 +
rust/kernel/net/phy.rs | 4 ++--
rust/uapi/lib.rs
us apply the
changes and enable the lint -- no functional change intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore
[1]
Reviewed-by: Benno Lossin
Signed-off-by: Tamir Duberstein
---
Makefile | 1 +
rust/kernel/block/mq/operati
1 - 100 of 131 matches
Mail list logo