rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] rust: Miscellaneous macro improvements
@ 2023-02-24  7:25 Asahi Lina
  2023-02-24  7:25 ` [PATCH 1/3] rust: macros: Make expect_punct() return the Punct directly Asahi Lina
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Asahi Lina @ 2023-02-24  7:25 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Boqun Feng,
	Gary Guo, Björn Roy Baron
  Cc: rust-for-linux, linux-kernel, asahi, Asahi Lina, Finn Behrens,
	Sumera Priyadarsini

Hi everyone!

This short series is part of the set of dependencies for the drm/asahi
Apple M1/M2 GPU driver.

The first two patches make concat_idents!(bindings::foo, bar) work.
I use this later in the DRM abstractions to construct DRM IOCTL command
names [1], which avoids having to import all of bindings::*.

The third patch allows specifying multiple module aliases. Since modules
can have multiple aliases, the macro naturally needs to be able to take
an array instead of a single alias. I don't use this in the current
iteration of the driver, since I introduced proper support for automatic
modpost alias generation for Rust modules, but it can be useful both to
remove that support as a blocking factor (we can specify aliases manually
as a fallback), and for modules which need extra aliases not covered by
device ID tables.

[1] https://github.com/AsahiLinux/linux/blob/gpu/rebase-20230224/rust/kernel/drm/ioctl.rs#L101

Signed-off-by: Asahi Lina <lina@asahilina.net>
---
Asahi Lina (3):
      rust: macros: Make expect_punct() return the Punct directly
      rust: macros: concat_idents: Allow :: paths in the first argument
      rust: macros: Allow specifying multiple module aliases
 rust/macros/concat_idents.rs | 24 +++++++++++++++++++++---
 rust/macros/helpers.rs       | 14 +++++++++++---
 rust/macros/module.rs        | 34 +++++++++++++++++++++++++++-------
 3 files changed, 59 insertions(+), 13 deletions(-)
---
base-commit: 83f978b63fa7ad474ca22d7e2772c5988101c9bd
change-id: 20230224-rust-macros-633dbf870ae1

Thank you,
~~ Lina


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-03-08 20:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-24  7:25 [PATCH 0/3] rust: Miscellaneous macro improvements Asahi Lina
2023-02-24  7:25 ` [PATCH 1/3] rust: macros: Make expect_punct() return the Punct directly Asahi Lina
2023-02-25  0:29   ` Gary Guo
2023-02-28  9:29   ` Finn Behrens
2023-03-01 17:16   ` Vincenzo Palazzo
2023-02-24  7:25 ` [PATCH 2/3] rust: macros: concat_idents: Allow :: paths in the first argument Asahi Lina
2023-02-25  0:31   ` Gary Guo
2023-03-07 20:22     ` Miguel Ojeda
2023-03-08 20:57     ` Miguel Ojeda
2023-03-01 17:18   ` Vincenzo Palazzo
2023-02-24  7:25 ` [PATCH 3/3] rust: macros: Allow specifying multiple module aliases Asahi Lina
2023-02-24  7:38   ` Greg KH
2023-02-24 12:41     ` Asahi Lina
2023-02-24 12:49       ` Greg KH
2023-03-01 17:19   ` Vincenzo Palazzo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).