public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Alice Ryhl" <aliceryhl@google.com>
Cc: <daniel.almeida@collabora.com>, <bhelgaas@google.com>,
	<kwilczynski@kernel.org>, <ojeda@kernel.org>,
	<boqun.feng@gmail.com>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
	<a.hindborg@kernel.org>, <tmgross@umich.edu>, <zhiw@nvidia.com>,
	<acourbot@nvidia.com>, <driver-core@lists.linux.dev>,
	<rust-for-linux@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>
Subject: Re: [PATCH] rust: io: macro_export io_define_read!() and io_define_write!()
Date: Mon, 16 Feb 2026 14:31:22 +0100	[thread overview]
Message-ID: <DGGF97AAA3HF.3DSNMFJTCNI9Z@kernel.org> (raw)
In-Reply-To: <aZMaFhvZWiknu8UK@google.com>

On Mon Feb 16, 2026 at 2:22 PM CET, Alice Ryhl wrote:
> You should keep these re-exports (as full `pub`) so that they can be
> accessed from kernel::io. Exposing all macros from crate root via
> #[macro_export] is legacy approach.

Good catch!

diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs
index 58f464cf5efd..e5fba6bf6db0 100644
--- a/rust/kernel/io.rs
+++ b/rust/kernel/io.rs
@@ -249,6 +249,7 @@ macro_rules! io_define_read {
         }
     };
 }
+pub use io_define_read;

 /// Generates an accessor method for writing to an I/O backend.
 ///
@@ -305,6 +306,7 @@ macro_rules! io_define_write {
         }
     };
 }
+pub use io_define_write;

 /// Checks whether an access of type `U` at the given `offset`
 /// is valid within this region.
diff --git a/rust/kernel/pci/io.rs b/rust/kernel/pci/io.rs
index 2c8d7d00e54d..fb6edab2aea7 100644
--- a/rust/kernel/pci/io.rs
+++ b/rust/kernel/pci/io.rs
@@ -8,14 +8,14 @@
     device,
     devres::Devres,
     io::{
+        io_define_read,
+        io_define_write,
         Io,
         IoCapable,
         IoKnownSize,
         Mmio,
         MmioRaw, //
     },
-    io_define_read,
-    io_define_write,
     prelude::*,
     sync::aref::ARef, //
 };


(I'd still keep the `io_` prefix though.)

  reply	other threads:[~2026-02-16 13:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 13:14 [PATCH] rust: io: macro_export io_define_read!() and io_define_write!() Danilo Krummrich
2026-02-16 13:22 ` Daniel Almeida
2026-02-16 13:22 ` Alice Ryhl
2026-02-16 13:31   ` Danilo Krummrich [this message]
2026-02-23 21:27     ` Alice Ryhl
2026-02-16 13:39 ` Alexandre Courbot
2026-02-16 13:47   ` Danilo Krummrich
2026-02-23 22:09 ` Danilo Krummrich

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=DGGF97AAA3HF.3DSNMFJTCNI9Z@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=daniel.almeida@collabora.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gary@garyguo.net \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=zhiw@nvidia.com \
    /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