public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Gary Guo" <gary@kernel.org>
Cc: "Gary Guo" <gary@garyguo.net>, "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH 0/8] I/O type generalization and projection
Date: Mon, 06 Apr 2026 00:01:39 +0900	[thread overview]
Message-ID: <DHLB8H63S0R6.1RP67M1C8S5G4@nvidia.com> (raw)
In-Reply-To: <20260323153807.1360705-1-gary@kernel.org>

On Tue Mar 24, 2026 at 12:37 AM JST, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> This series generalize `Mmio`/`MmioRaw` type from just an untyped region
> to typed representations (so `MmioRaw<T>` is `__iomem *T`). This allows
> us to remove the `IoKnownSize` trait; the information is sourced from
> just the pointer from the `KnownSize` trait instead.
>
> This enables us to implement `Io` trait for `Coherent<T>`, enabling
> unified handling of MMIO and DMA coherent memory. It also paves the way
> to uniformly support shared system memory, which Tyr will likely need
> [1].
>
> Built on this generalization, this series also add a `io::View` type
> which represents a subview of a bigger I/O region, and a `io_project!()`
> macro that provides a safe way to perform this. Some Nova code has been
> converted in this series to demonstrate cleanups possible with this
> addition.
>
> This series depend on the Coherent API rework series [2].
>
> Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/Generic.20I.2FO.20backends/near/572377073 [1]
> Link: https://lore.kernel.org/rust-for-linux/DH87CCNRR5EC.2SK3IT6N6Q8V5@nvidia.com/ [2]

I'm getting quite a few clippy warnings when applying this series:

    warning: lint `clippy::invalid_null_ptr_usage` has been renamed to `invalid_null_arguments`
      --> ../rust/kernel/pci/io.rs:78:9
      |
    78 |         clippy::invalid_null_ptr_usage,
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_null_arguments`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::invalid_null_ptr_usage` has been renamed to `invalid_null_arguments`
      --> ../rust/kernel/pci/io.rs:94:9
      |
    94 |         clippy::invalid_null_ptr_usage,
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_null_arguments`

    warning: macro has unnecessary safety comment
        --> ../rust/kernel/io.rs:1045:1
        |
    1045 | macro_rules! io_project {
        | ^^^^^^^^^^^^^^^^^^^^^^^^^
        |
    help: consider removing the safety comment
        --> ../rust/kernel/io.rs:1034:8
        |
    1034 | /// // SAFETY: Instances of `MyStruct` have no uninitialized portions.
        |        ^^^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unnecessary_safety_comment
        = note: requested on the command line with `-W clippy::unnecessary-safety-comment`

    warning: macro has unnecessary safety comment
        --> ../rust/kernel/io.rs:1086:1
        |
    1086 | macro_rules! io_read {
        | ^^^^^^^^^^^^^^^^^^^^^^
        |
    help: consider removing the safety comment
        --> ../rust/kernel/io.rs:1077:8
        |
    1077 | /// // SAFETY: Instances of `MyStruct` have no uninitialized portions.
        |        ^^^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unnecessary_safety_comment

    warning: macro has unnecessary safety comment
        --> ../rust/kernel/io.rs:1118:1
        |
    1118 | macro_rules! io_write {
        | ^^^^^^^^^^^^^^^^^^^^^^^
        |
    help: consider removing the safety comment
        --> ../rust/kernel/io.rs:1109:8
        |
    1109 | /// // SAFETY: Instances of `MyStruct` have no uninitialized portions.
        |        ^^^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unnecessary_safety_comment

    warning: 5 warnings emitted

  parent reply	other threads:[~2026-04-05 15:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OxgMwl1EcYLh4AqdBa-FaFap0ODNxpID-Hnns6odQVjvPTXqh6VoXM01bZmoVkAOF_5udNfKuCP8YJoW4UE5Fg==@protonmail.internalid>
2026-03-23 15:37 ` [PATCH 0/8] I/O type generalization and projection Gary Guo
2026-03-23 15:37   ` [PATCH 1/8] rust: io: generalize `MmioRaw` to pointer to arbitrary type Gary Guo
2026-03-26 12:53     ` Andreas Hindborg
2026-03-26 14:31       ` Gary Guo
2026-03-23 15:37   ` [PATCH 2/8] rust: io: generalize `Mmio` " Gary Guo
2026-03-26 13:04     ` Andreas Hindborg
2026-03-26 14:32       ` Gary Guo
2026-03-26 18:23         ` Andreas Hindborg
2026-04-02 12:57           ` Gary Guo
2026-04-04 18:57     ` Miguel Ojeda
2026-04-05 14:55     ` Alexandre Courbot
2026-04-05 23:21       ` Gary Guo
2026-04-06  4:00         ` Alexandre Courbot
2026-03-23 15:37   ` [PATCH 3/8] rust: io: use pointer types instead of address Gary Guo
2026-03-26 14:20     ` Andreas Hindborg
2026-03-26 14:35       ` Gary Guo
2026-03-27 10:11         ` Miguel Ojeda
2026-04-05 14:56     ` Alexandre Courbot
2026-04-05 15:00       ` Danilo Krummrich
2026-04-06  3:49         ` Alexandre Courbot
2026-03-23 15:37   ` [PATCH 4/8] rust: io: add view type Gary Guo
2026-03-26 14:31     ` Andreas Hindborg
2026-04-02 13:01       ` Gary Guo
2026-03-23 15:37   ` [PATCH 5/8] rust: dma: add methods to unsafely create reference from subview Gary Guo
2026-03-26 14:37     ` Andreas Hindborg
2026-03-26 14:44       ` Gary Guo
2026-03-23 15:37   ` [PATCH 6/8] rust: io: add `read_val` and `write_val` function on I/O view Gary Guo
2026-03-27  8:21     ` Andreas Hindborg
2026-03-27 12:19       ` Gary Guo
2026-03-23 15:37   ` [PATCH 7/8] gpu: nova-core: use I/O projection for cleaner encapsulation Gary Guo
2026-03-23 15:38   ` [PATCH 8/8] rust: dma: drop `dma_read!` and `dma_write!` API Gary Guo
2026-03-27  8:25     ` Andreas Hindborg
2026-03-25 11:11   ` [PATCH 0/8] I/O type generalization and projection Andreas Hindborg
2026-03-25 11:19     ` Miguel Ojeda
2026-04-05 15:01   ` Alexandre Courbot [this message]
2026-04-05 23:17     ` Gary Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DHLB8H63S0R6.1RP67M1C8S5G4@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=gary@kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox