Use struct devres_node in Devres<T>
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 3 repliesIn review
- v15 patches 19 repliesSuperseded
Changes in v2 from the cover letter
- Prevent driver-core internal C APIs from potentially being called directly from driver modules due to monomorphisation, to prevent unnecessary symbol exports.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | devres: move struct devres_node into base.hdrivers/ drivers/ | +12 | 0 replies | |
| 2/5 | devres: export devres_node_init() and devres_node_add()drivers/ drivers/ | +7 | 0 replies | |
| 3/5 | devres: add devres_node_remove()drivers/ drivers/ | +17 | 0 replies | |
| 4/5 | devres: rename and export set_node_dbginfo()drivers/ drivers/ | +9 | 0 replies | |
| 5/5 | rust: devres: embed struct devres_node directlyrust/ | +135 | 1 reply |
Reviews trailers per patch
1 of 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Alice Ryhl | Greg Kroah-Hartman |
|---|---|---|
| Series | A-b | |
| 1/5 | ||
| 2/5 | ||
| 3/5 | ||
| 4/5 | ||
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/5] Use struct devres_node in Devres<T>
Currently, the Devres<T> container uses devm_add_action() to register a devres callback.
devm_add_action() allocates a struct action_devres, which on top of struct devres_node, just keeps a data pointer and release function pointer.
This is an unnecessary indirection, given that analogous to struct devres, the Devres<T> container can just embed a struct devres_node directly without an additional allocation.
In contrast to struct devres, we don't need to force an alignment of ARCH_DMA_MINALIGN (as struct devres does to account for the worst case) since we have generics in Rust. I.e. the compiler already ensures correct alignment of the embedded T in Devres<T>.
Thus, get rid of devm_add_action() and instead embed a struct devres_node directly.
This patch series is based on [1].
[1] https://lore.kernel.org/lkml/[email protected]/
Changes in v2:
- Prevent driver-core internal C APIs from potentially being called directly from driver modules due to monomorphisation, to prevent unnecessary symbol exports.
Danilo Krummrich (5):
devres: move struct devres_node into base.h
devres: export devres_node_init() and devres_node_add()
devres: add devres_node_remove()
devres: rename and export set_node_dbginfo()
rust: devres: embed struct devres_node directly
drivers/base/base.h | 18 +++++ drivers/base/devres.c | 50 ++++++------ rust/kernel/devres.rs | 182 +++++++++++++++++++++++++++++++----------- 3 files changed, 180 insertions(+), 70 deletions(-)
base-commit: 1680377f05a809e4489731ad0e5a5fd5471ec40e
Signature · 1 line
2.53.0