cleanup: Remove NULL check from unconditional guards
Status from this message: The following commit has been merged into the locking/core branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest4 patches 5 repliesApplied
- v44 patches 5 repliesSuperseded
- v34 patches 4 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 1 patch | 3 replies | Superseded | |
| v1 | 1 patch | 0 replies | Superseded |
Changes in v5 from the cover letter
- Renamed __nonnull() attribute to __nonnull_args() to fix User Mode Linux build failures (kernel test robot).
- Dropped Acked-by tag from Miguel, since I renamed the attribute.
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | nvdimm: Convert nvdimm_bus guard to classdrivers/ | +5 | 0 replies | |
| 2/4 | genirq: Move NULL check into irqdesc_lock guard unlock expressionkernel/ | +1 | 1 reply | |
| 3/4 | cleanup: Annotate guard constructors with nonnullinclude/ include/ | +12 | 4 replies | |
| 4/4 | cleanup: Remove NULL check from unconditional guardsinclude/ | +2 | 0 replies |
Reviews trailers per patch
2 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Dave Jiang | Thomas Gleixner |
|---|---|---|
| 1/4 | R-b | |
| 2/4 | A-b | |
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/4] cleanup: Remove NULL check from unconditional guards
Unconditional guard destructors have dead NULL checks. The lock operation in the constructor would crash before the destructor ever runs with NULL.
- Patches 1-2 prepare guards that legitimately handle NULL.
- Patch 3 adds __nonnull_args() to guard constructors for compile-time enforcement.
- Patch 4 removes the dead checks.
As compiled by GCC-11 with defconfig on top of the locking/core:
Total: Before=23889980, After=23834334, chg -0.23%
Changes in v5:
- Renamed __nonnull() attribute to __nonnull_args() to fix User Mode Linux build failures (kernel test robot).
- Dropped Acked-by tag from Miguel, since I renamed the attribute.
Changes in v4:
- Re-worded commit message paragraph about nonnull "compiler-enforced verification" (Miguel Ojeda).
- Fixed GCC documentation link for nonnull() attribute (Miguel Ojeda).
- Placed nonnull() before nonstring() in include/linux/compiler_attributes.h (Miguel Ojeda).
- Picked up tags, where appropriate.
Changes in v3:
- Audited usages of DEFINE_GUARD(), __DEFINE_UNLOCK_GUARD() and DEFINE_LOCK_GUARD_1() to make sure NULL check removal will work correctly (Peter Zijlstra).
- Moved NULL check into irqdesc_lock unlock expression (Peter Zijlstra).
- Added compiler-enforced nonnull() check for guard constructors.
- Converted nvdimm_bus guard to class.
Changes in v2:
- Expand commit message with detailed reasoning, why the proposed change is correct.
- Rebase on top of locking/core.
v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/
See also [1] for relevant discussion.
[1]: https://lore.kernel.org/all/[email protected]/
Dmitry Ilvokhin (4):
nvdimm: Convert nvdimm_bus guard to class
genirq: Move NULL check into irqdesc_lock guard unlock expression
cleanup: Annotate guard constructors with nonnull
cleanup: Remove NULL check from unconditional guards
drivers/nvdimm/nd.h | 7 +++++-- include/linux/cleanup.h | 8 +++++--- include/linux/compiler_attributes.h | 9 +++++++++ kernel/irq/internals.h | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-)
Signature · 1 line
2.53.0-Meta