[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251017012649.GA1009471@bhelgaas>
Date: Thu, 16 Oct 2025 20:26:49 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Zhi Wang <zhiw@...dia.com>
Cc: rust-for-linux@...r.kernel.org, dakr@...nel.org, bhelgaas@...gle.com,
kwilczynski@...nel.org, ojeda@...nel.org, alex.gaynor@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
lossin@...nel.org, a.hindborg@...nel.org, aliceryhl@...gle.com,
tmgross@...ch.edu, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, cjia@...dia.com, smitra@...dia.com,
ankita@...dia.com, aniketa@...dia.com, kwankhede@...dia.com,
targupta@...dia.com, zhiwang@...nel.org, acourbot@...dia.com,
joelagnelf@...dia.com, jhubbard@...dia.com, markus.probst@...teo.de
Subject: Re: [PATCH v2 1/5] rust/io: factor common I/O helpers into Io trait
and specialize Mmio<SIZE>
On Thu, Oct 16, 2025 at 09:02:46PM +0000, Zhi Wang wrote:
> The previous Io<SIZE> type combined both the generic I/O access helpers
> and MMIO implementation details in a single struct.
>
> To establish a cleaner layering between the I/O interface and its concrete
> backends, paving the way for supporting additional I/O mechanisms in the
> future, Io<SIZE> need to be factored.
>
> Factor the common helpers into a new Io trait, and moves the MMIO-specific
> logic into a dedicated Mmio<SIZE> type implementing that trait. Rename the
> IoRaw to MmioRaw and pdate the bus MMIO implementations to use MmioRaw.
s/and moves/and move/ to match "Factor" and "Rename"
s/pdate/update/ ?
> +/// Instead, the bus specific MMIO implementation must convert this raw representation into an
> +/// `Mmio` instance providing the actual memory accessors. Only by the conversion into an `Mmio`
> +/// structure any guarantees are given.
s/any guarantees are given/are any guarantees given/
> + /// Returns a new `MmioRaw` instance ...
> +/// Provides common helpers ...
> + /// Checks whether an access ...
There's a Linux trend toward using "imperative mood", e.g., "Return",
for commit logs and comments, but I notice Rust code more often seems
to use the indicative mood: "Returns", "Provides", "Checks", etc.
Maybe that's part of the Rust style; I dunno if that's intentional or
worth commenting on, just something I notice.
Bjorn
Powered by blists - more mailing lists