[PATCH v4 0/6] replace `allow(...)` lints with `expect(...)`

Onur Özkan posted 6 patches 3 months, 1 week ago
drivers/gpu/nova-core/regs.rs       | 2 +-
rust/kernel/alloc/allocator_test.rs | 2 +-
rust/kernel/cpufreq.rs              | 1 -
rust/kernel/devres.rs               | 2 +-
rust/kernel/driver.rs               | 2 +-
rust/kernel/drm/ioctl.rs            | 8 ++++----
rust/kernel/error.rs                | 3 +--
rust/kernel/init.rs                 | 6 +++---
rust/kernel/kunit.rs                | 2 +-
rust/kernel/types.rs                | 2 +-
rust/macros/helpers.rs              | 2 +-
11 files changed, 15 insertions(+), 17 deletions(-)
[PATCH v4 0/6] replace `allow(...)` lints with `expect(...)`
Posted by Onur Özkan 3 months, 1 week ago
Changes in v4:
  - The first patch from previous versions is now
    broken down into multiple smaller patches.
  - `#![expect(dead_code)]` is reverted from
    `rust/kernel/opp.rs` as it failed on the
    kernel test bot (see [1] for more).


Link: https://lore.kernel.org/all/202506291507.M9eg5kic-lkp@intel.com [1]

Onur Özkan (6):
  rust: switch to `#[expect(...)]` in core modules
  rust: switch to `#[expect(...)]` in init and kunit
  drivers: gpu: switch to `#[expect(...)]` in nova-core/regs.rs
  rust: switch to `#[expect(...)]` in devres, driver and ioctl
  rust: remove `#[allow(clippy::unnecessary_cast)]`
  rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

 drivers/gpu/nova-core/regs.rs       | 2 +-
 rust/kernel/alloc/allocator_test.rs | 2 +-
 rust/kernel/cpufreq.rs              | 1 -
 rust/kernel/devres.rs               | 2 +-
 rust/kernel/driver.rs               | 2 +-
 rust/kernel/drm/ioctl.rs            | 8 ++++----
 rust/kernel/error.rs                | 3 +--
 rust/kernel/init.rs                 | 6 +++---
 rust/kernel/kunit.rs                | 2 +-
 rust/kernel/types.rs                | 2 +-
 rust/macros/helpers.rs              | 2 +-
 11 files changed, 15 insertions(+), 17 deletions(-)

--
2.50.0

Re: [PATCH v4 0/6] replace `allow(...)` lints with `expect(...)`
Posted by Miguel Ojeda 3 months, 1 week ago
On Tue, Jul 1, 2025 at 7:36 AM Onur Özkan <work@onurozkan.dev> wrote:
>
> Onur Özkan (6):
>   rust: switch to `#[expect(...)]` in core modules
>   rust: switch to `#[expect(...)]` in init and kunit
>   drivers: gpu: switch to `#[expect(...)]` in nova-core/regs.rs
>   rust: switch to `#[expect(...)]` in devres, driver and ioctl
>   rust: remove `#[allow(clippy::unnecessary_cast)]`
>   rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

Thanks for splitting this, it is very much appreciated.

I think you decided on a split based on similarity (?). In the kernel,
different maintainers/trees take care of different areas/files (the
`MAINTAINERS` file describes this mapping). For instance, in one of
them, KUnit and init is mixed, which are maintained by different
people.

That is why the split I suggested was one that allows maintainers to
pick them independently. With this one, maintainers still have to
coordinate, which isn't a big deal, since the changes are small and
straightforward, but the purpose of the split was to avoid that.

Cheers,
Miguel
Re: [PATCH v4 0/6] replace `allow(...)` lints with `expect(...)`
Posted by Onur 3 months, 1 week ago
On Tue, 1 Jul 2025 10:43:10 +0200
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:

> On Tue, Jul 1, 2025 at 7:36 AM Onur Özkan <work@onurozkan.dev> wrote:
> >
> > Onur Özkan (6):
> >   rust: switch to `#[expect(...)]` in core modules
> >   rust: switch to `#[expect(...)]` in init and kunit
> >   drivers: gpu: switch to `#[expect(...)]` in nova-core/regs.rs
> >   rust: switch to `#[expect(...)]` in devres, driver and ioctl
> >   rust: remove `#[allow(clippy::unnecessary_cast)]`
> >   rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`
> 
> Thanks for splitting this, it is very much appreciated.
> 
> I think you decided on a split based on similarity (?). In the kernel,
> different maintainers/trees take care of different areas/files (the
> `MAINTAINERS` file describes this mapping). For instance, in one of
> them, KUnit and init is mixed, which are maintained by different
> people.

I didn't know I could use `MAINTAINERS` file to organize my changes.

> That is why the split I suggested was one that allows maintainers to
> pick them independently. With this one, maintainers still have to
> coordinate, which isn't a big deal, since the changes are small and
> straightforward, but the purpose of the split was to avoid that.


I see, I will make sure to use `MAINTAINERS` file as a ref next
time, thank you. :)

Regards,
Onur