[PATCH 0/2] rust: add functions and traits for lossless integer conversions

Alexandre Courbot <[email protected]> Mon, 27 Jul 2026 19:15:13 +0900
Newsgroups dev.linux.lists.nova-gpu,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
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.

It is way overdue since its RFC [1]; recent dicussions [2] that have
suggested that it might become useful have triggered this posting.

This series is based on `rust-next`.

[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/all/[email protected]/

Signed-off-by: Alexandre Courbot <[email protected]>
---
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/[email protected]

To: Alexandre Courbot <[email protected]>
To: Yury Norov <[email protected]>
To: Miguel Ojeda <[email protected]>
To: Boqun Feng <[email protected]>
To: Gary Guo <[email protected]>
To: Björn Roy Baron <[email protected]>
To: Benno Lossin <[email protected]>
To: Andreas Hindborg <[email protected]>
To: Alice Ryhl <[email protected]>
To: Trevor Gross <[email protected]>
To: Danilo Krummrich <[email protected]>
To: Daniel Almeida <[email protected]>
To: Tamir Duberstein <[email protected]>
To: Onur Özkan <[email protected]>
To: David Airlie <[email protected]>
To: Simona Vetter <[email protected]>
Cc: John Hubbard <[email protected]>
Cc: Alistair Popple <[email protected]>
Cc: Timur Tabi <[email protected]>
Cc: Eliot Courtney <[email protected]>
Cc: Zhi Wang <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
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                    |  10 +-
 drivers/gpu/nova-core/falcon/fsp.rs                |   2 +-
 drivers/gpu/nova-core/fb.rs                        |   2 +-
 drivers/gpu/nova-core/fb/hal/gb100.rs              |   6 +-
 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              |   2 +-
 drivers/gpu/nova-core/firmware/riscv.rs            |   6 +-
 drivers/gpu/nova-core/fsp.rs                       |   2 +-
 drivers/gpu/nova-core/gsp.rs                       |   2 +-
 drivers/gpu/nova-core/gsp/cmdq.rs                  |   4 +-
 drivers/gpu/nova-core/gsp/fw.rs                    |   8 +-
 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                                 |   3 +
 rust/kernel/num/casts.rs                           | 248 +++++++++++++++++++++
 19 files changed, 286 insertions(+), 246 deletions(-)
---
base-commit: 3dab139d4795f688e4f243e40c7474df00d329d9
change-id: 20251104-as_casts-6a8882ac0192

Best regards,
--  
Alexandre Courbot <[email protected]>