public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] rust, nova-core: add DeviceSize trait for SZ_* constants
@ 2026-03-31 22:43 John Hubbard
  2026-03-31 22:43 ` [PATCH v3 1/2] rust: sizes: add DeviceSize trait for device address space constants John Hubbard
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: John Hubbard @ 2026-03-31 22:43 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot
  Cc: Joel Fernandes, Timur Tabi, Alistair Popple, Eliot Courtney,
	Shashank Sharma, Zhi Wang, David Airlie, Simona Vetter,
	Bjorn Helgaas, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, LKML, John Hubbard

Changes in v3:
  * Dropped the Alignment::from_u64() patch.

  * Reworked define_sizes! macro to accept target types as arguments
    (define_sizes!(u32, u64, usize)) using recursive macro arms,
    instead of hardcoding impls for u32 and u64. Overflow checking
    uses u128 casts so the same assert works for any ("reasonable")
    target type.

  * Added usize to the DeviceSize implementations, so the trait
    covers u32, u64, and usize.

  * Hex values for each constant are now proper doc-comments
    (forwarded via macro meta), instead of inline comments.

  * Rebased onto latest drm-rust-next.

Changes in v2:
  * Replaced flat SZ_*_U64 constants with a DeviceSize trait that
    provides SZ_* as associated constants on u32 and u64.

  * A define_sizes! macro generates everything from one list of names.

  * Added Alignment::from_u64() so alignment values can be constructed
    from DeviceSize constants without falling back to usize variants.

  * Rebased onto drm-rust-next. No longer depends on the Blackwell
    patchset.

v1 is here:
    https://lore.kernel.org/20260310023145.120037-1-jhubbard@nvidia.com

John Hubbard (2):
  rust: sizes: add DeviceSize trait for device address space constants
  gpu: nova-core: use DeviceSize trait for u64 size constants

 drivers/gpu/nova-core/fb.rs     |  21 ++--
 drivers/gpu/nova-core/gsp/fw.rs |  15 ++-
 drivers/gpu/nova-core/regs.rs   |   7 +-
 rust/kernel/sizes.rs            | 166 +++++++++++++++++++++++---------
 4 files changed, 141 insertions(+), 68 deletions(-)


base-commit: 7c50d748b4a635bc39802ea3f6b120e66b1b9067
-- 
2.53.0


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

end of thread, other threads:[~2026-04-04  1:46 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 22:43 [PATCH v3 0/2] rust, nova-core: add DeviceSize trait for SZ_* constants John Hubbard
2026-03-31 22:43 ` [PATCH v3 1/2] rust: sizes: add DeviceSize trait for device address space constants John Hubbard
2026-04-01  9:46   ` Alice Ryhl
2026-04-01 20:22     ` John Hubbard
2026-04-01 21:20       ` Danilo Krummrich
2026-04-01 21:29         ` John Hubbard
2026-04-02  1:42         ` Alexandre Courbot
2026-04-03  1:36           ` John Hubbard
2026-04-03  8:21             ` Alexandre Courbot
2026-04-03 12:56               ` Gary Guo
2026-04-03 13:07             ` Danilo Krummrich
2026-04-04  1:46               ` John Hubbard
2026-04-01 10:16   ` Miguel Ojeda
2026-04-01 20:33     ` John Hubbard
2026-03-31 22:43 ` [PATCH v3 2/2] gpu: nova-core: use DeviceSize trait for u64 size constants John Hubbard
2026-04-01  7:01 ` [PATCH v3 0/2] rust, nova-core: add DeviceSize trait for SZ_* constants Eliot Courtney
2026-04-01 20:46   ` John Hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox