The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/2] rust: add functions and traits for lossless integer conversions
@ 2026-08-06  7:35 Alexandre Courbot
  2026-08-06  7:35 ` [PATCH v2 1/2] " Alexandre Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexandre Courbot @ 2026-08-06  7:35 UTC (permalink / raw)
  To: Alexandre Courbot, Yury Norov, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Onur Özkan, David Airlie, Simona Vetter
  Cc: John Hubbard, Alistair Popple, Timur Tabi, Eliot Courtney,
	Zhi Wang, linux-kernel, rust-for-linux, nova-gpu, dri-devel

This series introduces a copy of the lossless integer conversion
functions/traits of `nova-core` into the `kernel` crate, and makes
`nova-core` use them.

This revision addresses the feedback received on v1 by making
architecture-dependent conversions available via a dedicated `arch`
sub-module to make it more obvious that they are not portable.

This series is based on `rust-next`.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v2:
- Move architecture-dependent conversions into `arch` sub-module, and
  use dedicated trait names.
- Use `use crate::` instead of `use kernel::` for kernel imports.
- Replace use of `build_assert!` with `const_assert!` (Sashiko).
- `#[inline]` all the functions (Sashiko).
- Remove stray `#[allow(unused)]`.
- Group kernel imports properly (Sashiko).
- Do not reexport the contents of `casts` in `num`.
- Link to v1: https://patch.msgid.link/20260727-as_casts-v1-0-6ea704ff25d8@nvidia.com

Changes in v1:
- Update to latest version in `nova-core`.
- Make `nova-core` use the kernel crate implementation and remove its
  own.
- Link to RFC: https://lore.kernel.org/r/20251104-as_casts-v1-1-0a0e95bd2a9f@nvidia.com

---
Alexandre Courbot (2):
      rust: add functions and traits for lossless integer conversions
      gpu: nova-core: use kernel lossless integer conversion module

 drivers/gpu/nova-core/falcon.rs                    |  12 +-
 drivers/gpu/nova-core/falcon/fsp.rs                |   4 +-
 drivers/gpu/nova-core/fb.rs                        |   2 +-
 drivers/gpu/nova-core/fb/hal/gb100.rs              |  11 +-
 drivers/gpu/nova-core/firmware.rs                  |   8 +-
 drivers/gpu/nova-core/firmware/booter.rs           |  10 +-
 drivers/gpu/nova-core/firmware/fwsec.rs            |   2 +-
 drivers/gpu/nova-core/firmware/fwsec/bootloader.rs |   2 +-
 drivers/gpu/nova-core/firmware/gsp.rs              |   7 +-
 drivers/gpu/nova-core/firmware/riscv.rs            |   6 +-
 drivers/gpu/nova-core/fsp.rs                       |   4 +-
 drivers/gpu/nova-core/gsp.rs                       |   4 +-
 drivers/gpu/nova-core/gsp/cmdq.rs                  |  24 +-
 drivers/gpu/nova-core/gsp/fw.rs                    |  42 +--
 drivers/gpu/nova-core/gsp/sequencer.rs             |   2 +-
 drivers/gpu/nova-core/num.rs                       | 211 ---------------
 drivers/gpu/nova-core/vbios.rs                     |   2 +-
 rust/kernel/num.rs                                 |   2 +
 rust/kernel/num/casts.rs                           | 298 +++++++++++++++++++++
 19 files changed, 373 insertions(+), 280 deletions(-)
---
base-commit: dc01dfb37b34beeefcfe1c3055364d41a4070c7e
change-id: 20251104-as_casts-6a8882ac0192

Best regards,
--  
Alexandre Courbot <acourbot@nvidia.com>


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

end of thread, other threads:[~2026-08-06 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06  7:35 [PATCH v2 0/2] rust: add functions and traits for lossless integer conversions Alexandre Courbot
2026-08-06  7:35 ` [PATCH v2 1/2] " Alexandre Courbot
2026-08-06  7:35 ` [PATCH v2 2/2] gpu: nova-core: use kernel lossless integer conversion module Alexandre Courbot
2026-08-06 21:10 ` [PATCH v2 0/2] rust: add functions and traits for lossless integer conversions Danilo Krummrich

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