`Zeroable` improvements & bindings integration
Status from this message: Applied these #1, #2 and #11 to `rust-next` -- thanks everyone!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest11 patches 17 repliesApplied
- v213 patches 13 repliesSuperseded
Patches in v3 Applied
Reviews trailers per patch
4 of 11 patches have a Reviewed-by or Acked-by.
| Patch | Viresh Kumar | Alice Ryhl | Andreas Hindborg |
|---|---|---|---|
| 1/11 | R-b | ||
| 2/11 | R-b | ||
| 3/11 | |||
| 4/11 | |||
| 5/11 | A-b | ||
| 6/11 | |||
| 7/11 | |||
| 8/11 | |||
| 9/11 | |||
| 10/11 | |||
| 11/11 | 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 3 reviewers.
Cover letter [PATCH v3 00/11] `Zeroable` improvements & bindings integration
This came from a discussion at [1]. And I added some more useful parts to the original idea.
I'm not sure on the impact of build times and rust-analyzer. We're adding a derive macro to every struct and union emitted by bindgen. Building using my test-config took 27.7s before and 28.2s after this change, but those are only two runs on my machine with a very reduced config (that enables all Rust code that we have at the moment).
Maybe we have to reevaluate this when more C code is scanned by bindgen.
Changelog
=========
* v3:
- removed already applied patches
- added more patches replacing usage of mem::zeroed and MaybeUninit::zeroed().assume_init() with the new pin_init::zeroed
- fix rusttest target
* v2:
- added patches with more extensive pin-init changes to Zeroable & related methods. for the upstream PR, see
https://github.com/Rust-for-Linux/pin-init/pull/56
- added patches replacing usage of mem::zeroed and MaybeUninit::zeroed().assume_init() with the new pin_init::zeroed
- fix rust-analyzer support
- use import in {uapi,bindings}/lib.rs to avoid the pin_init:: prefix
* v1: https://lore.kernel.org/all/[email protected]
Benno Lossin (11):
rust: add pin-init as a dependency to bindings and uapi
rust: derive Zeroable for all structs & unions generated by bindgen
where possible
rust: miscdevice: replace MaybeUninit::zeroed().assume_init() with
`pin_init::zeroed()`
rust: phy: replace `MaybeUninit::zeroed().assume_init()` with
`pin_init::zeroed()`
rust: block: replace `core::mem::zeroed` with `pin_init::zeroed`
rust: of: replace `core::mem::zeroed` with `pin_init::zeroed`
rust: security: replace `core::mem::zeroed` with `pin_init::zeroed`
rust: drm: replace `core::mem::zeroed` with `pin_init::zeroed`
rust: auxiliary: replace `core::mem::zeroed` with `pin_init::zeroed`
rust: acpi: replace `core::mem::zeroed` with `pin_init::zeroed`
rust: cpufreq: replace `MaybeUninit::zeroed().assume_init()` with
`pin_init::zeroed()`rust/Makefile | 14 ++++++++------ rust/bindgen_parameters | 4 ++++ rust/bindings/lib.rs | 8 ++++++++ rust/kernel/acpi.rs | 4 +--- rust/kernel/auxiliary.rs | 6 +----- rust/kernel/block/mq/gen_disk.rs | 3 +-- rust/kernel/block/mq/tag_set.rs | 4 +--- rust/kernel/cpufreq.rs | 4 +--- rust/kernel/drm/gem/mod.rs | 4 +--- rust/kernel/miscdevice.rs | 8 +++----- rust/kernel/net/phy.rs | 4 +--- rust/kernel/of.rs | 4 +--- rust/kernel/security.rs | 3 +-- rust/uapi/lib.rs | 2 ++ scripts/generate_rust_analyzer.py | 4 ++-- 15 files changed, 36 insertions(+), 40 deletions(-)
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
Signature · 1 line
2.50.1