public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] rust, nova-core: add DeviceSize trait for SZ_* constants
@ 2026-03-12  3:15 John Hubbard
  2026-03-12  3:15 ` [PATCH v2 1/3] rust: sizes: add DeviceSize trait for device address space constants John Hubbard
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: John Hubbard @ 2026-03-12  3:15 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 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 (3):
  rust: sizes: add DeviceSize trait for device address space constants
  rust: ptr: add Alignment::from_u64() for DeviceSize constants
  gpu: nova-core: use DeviceSize trait for u64 size constants

 drivers/gpu/nova-core/fb.rs     |  31 ++++----
 drivers/gpu/nova-core/gsp/fw.rs |  18 ++---
 drivers/gpu/nova-core/regs.rs   |   6 +-
 rust/kernel/ptr.rs              |  35 +++++++++
 rust/kernel/sizes.rs            | 132 +++++++++++++++++++++-----------
 5 files changed, 147 insertions(+), 75 deletions(-)


base-commit: a544873ce0575b2fd8285a1364d3e09929d9a3ba
-- 
2.53.0


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

end of thread, other threads:[~2026-03-24 14:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12  3:15 [PATCH v2 0/3] rust, nova-core: add DeviceSize trait for SZ_* constants John Hubbard
2026-03-12  3:15 ` [PATCH v2 1/3] rust: sizes: add DeviceSize trait for device address space constants John Hubbard
2026-03-24 14:32   ` Alexandre Courbot
2026-03-12  3:15 ` [PATCH v2 2/3] rust: ptr: add Alignment::from_u64() for DeviceSize constants John Hubbard
2026-03-12  6:16   ` Miguel Ojeda
2026-03-12  6:23     ` John Hubbard
2026-03-24 14:19   ` Gary Guo
2026-03-12  3:15 ` [PATCH v2 3/3] gpu: nova-core: use DeviceSize trait for u64 size constants John Hubbard
2026-03-24 14:06   ` Alexandre Courbot

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