Skip to content

add `const_assert!` macro and rework documentation

Gary Guo dri-devel driver-core linux-kbuild lkml netdev nouveau rust-for-linux 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 21 repliesIn review
  2. v24 patches 4 repliesSuperseded
  3. v12 patches 14 repliesSuperseded

Changes in v3 from the cover letter

- Rebased on top of latest linux-next to pick up register! changes
- Drop the unintended removal of #[inline(always)] doc on
build_assert! (Sashiko)
- Remove imports covered by prelude (Danilo)
- Fix references in Nova and new register! macro
- Link to v2: https://lore.kernel.org/rust-for-linux/[email protected]/

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4rust: move `static_assert` into `build_assert`rust/kernel/build_assert.rs rust/kernel/lib.rs rust/kernel/prelude.rs +1 more+38 -461 reply
2/4rust: add `const_assert!` macrorust/kernel/build_assert.rs rust/kernel/num/bounded.rs rust/kernel/prelude.rs +2 more+48 -244 replies
3/4rust: rework `build_assert!` documentationrust/kernel/build_assert.rs rust/kernel/lib.rs+92 -282 replies
4/4rust: make `build_assert` module the home of related macrosdrivers/gpu/nova-core/bitfield.rs drivers/gpu/nova-core/num.rs rust/kernel/build_assert.rs +12 more+61 -3612 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchYury NorovAlice RyhlDanilo KrummrichAlexandre CourbotTamir DubersteinFUJITA TomonoriBoqun Feng
SeriesR-b
1/4R-b R-b
2/4R-b R-b R-b
3/4R-b R-b R-b
4/4R-b A-b A-b A-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/4] add `const_assert!` macro and rework documentation

From: Gary Guo <[email protected]>

This adds the const_assert! macro, rework documentation of all build-time assertion macros to live under build_assert module, and make that the canonical path to refer to these macros.

The Rust documentation rendering side can be tested out with make rustdoc command.

Changes since v2:
- Rebased on top of latest linux-next to pick up register! changes
- Drop the unintended removal of #[inline(always)] doc on
build_assert! (Sashiko)
- Remove imports covered by prelude (Danilo)
- Fix references in Nova and new register! macro
- Link to v2: https://lore.kernel.org/rust-for-linux/[email protected]/

Changes since v1:
- Completely overhaul of the documentation
- Make kernel::build_assert the canonical path to refer to related macros
- Link to v1: https://lore.kernel.org/rust-for-linux/[email protected]/

Cc Yury Norov <[email protected]>

Gary Guo (4):
rust: move static_assert into build_assert
rust: add const_assert! macro
rust: rework build_assert! documentation
rust: make build_assert module the home of related macros

 drivers/gpu/nova-core/bitfield.rs    |   4 +-
 drivers/gpu/nova-core/num.rs         |   2 +-
 rust/kernel/build_assert.rs          | 200 ++++++++++++++++++++++-----
 rust/kernel/dma.rs                   |   5 +-
 rust/kernel/io/register.rs           |  19 ++-
 rust/kernel/io/resource.rs           |   2 +-
 rust/kernel/ioctl.rs                 |   2 +-
 rust/kernel/lib.rs                   |   2 -
 rust/kernel/net/phy/reg.rs           |   8 +-
 rust/kernel/num/bounded.rs           |  26 ++--
 rust/kernel/prelude.rs               |  10 +-
 rust/kernel/ptr.rs                   |  12 +-
 rust/kernel/static_assert.rs         |  39 ------
 rust/kernel/sync/atomic/internal.rs  |   9 +-
 rust/kernel/sync/atomic/predefine.rs |   2 +-
 rust/kernel/sync/locked_by.rs        |   2 +-
 rust/kernel/sync/refcount.rs         |   8 +-
 rust/kernel/xarray.rs                |  10 +-
 scripts/Makefile.build               |   5 +-
 19 files changed, 236 insertions(+), 131 deletions(-)
 delete mode 100644 rust/kernel/static_assert.rs

base-commit: 8e42d2514a7e8eb8d740d0ba82339dd6c0b6463f

Signature · 1 line
2.51.2