Skip to content

treewide: switch to __nonnull_args() macro

Dmitry Ilvokhin amd-gfx dri-devel intel-gfx linux-arm-kernel linux-aspeed linux-doc linux-fsdevel linux-hardening linux-leds linux-mm lkml 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 19 repliesApplied 1/10

Patches in v1 Applied · 1/10

#Subject and filesSizeRepliesApplied
1/10docs: xforms_lists: support __nonnull_args()tools/lib/python/kdoc/xforms_lists.py+1 -00 replies
2/10string: Switch to __nonnull_args() macroinclude/linux/string.h+1 -11 reply
3/10lib/list_sort: Switch to __nonnull_args() macroinclude/linux/list_sort.h lib/list_sort.c+5 -51 reply
4/10xarray: switch to __nonnull_args() macroinclude/linux/xarray.h tools/include/linux/compiler.h+6 -20 replies
5/10drm/i915: switch to __nonnull_args() macrodrivers/gpu/drm/i915/gem/i915_gem_object.h drivers/gpu/drm/i915/i915_request.h+4 -44 repliesApplied
6/10drm/amdgpu: switch to __nonnull_args() macrodrivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+1 -10 replies
7/10drm/gem: Switch to __nonnull_args() macroinclude/drm/drm_gem.h+1 -17 replies
8/10leds: pwm: Switch to __nonnull_args() macrodrivers/leds/leds-pwm.c+1 -12 replies
9/10soc: aspeed: lpc-snoop: Switch to __nonnull_args() macrodrivers/soc/aspeed/aspeed-lpc-snoop.c+2 -20 replies
10/10checkpatch: suggest nonnull attribute conversionscripts/checkpatch.pl+3 -01 reply

Reviews trailers per patch

5 of 10 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoJani NikulaAndi ShytiThomas Zimmermann
1/10
2/10R-b
3/10R-b
4/10
5/10R-b A-b R-b
6/10
7/10R-b R-b
8/10R-b
9/10
10/10

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

Read the v1 thread

Cover letter [PATCH 00/10] treewide: switch to __nonnull_args() macro

Commit 22302af28d3f ("cleanup: Annotate guard constructors with nonnull") added the __nonnull_args() macro to wrap the raw compiler attribute, keeping the attribute's quirks in one place rather than open-coded at every call site.

This series replaces the remaining open-coded __attribute__((nonnull)) users with __nonnull_args() to standardize nonnull attribute usage across the tree.

Each patch can be applied separately by the respective maintainers. The only dependency is kernel-doc: the string and lib/list_sort patches need patch 1 ("docs: xforms_lists: support __nonnull_args()") in the same release, otherwise strends() and list_sort() drop out of the generated documentation.

Latest Sparse release could not properly parse __nonnull_args() without arguments. Fix was proposed [1] and merged, but until updated version of Sparse will reach wide masses it might trip on __nonnull_args() without arguments.

There are few more instances of __attribute__((nonnull)) usages left in the tools subdirectory, they are perf related copied files and can (should?) be updated separately after this patchset lands.

Build-tested allmodconfig with GCC 11.5.0 and clang 22.1.8.

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

Dmitry Ilvokhin (10):
docs: xforms_lists: support __nonnull_args()
string: Switch to __nonnull_args() macro lib/list_sort: Switch to __nonnull_args() macro
xarray: switch to __nonnull_args() macro drm/i915: switch to __nonnull_args() macro drm/amdgpu: switch to __nonnull_args() macro drm/gem: Switch to __nonnull_args() macro
leds: pwm: Switch to __nonnull_args() macro
soc: aspeed: lpc-snoop: Switch to __nonnull_args() macro
checkpatch: suggest nonnull attribute conversion

 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    | 2 +-
 drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ++--
 drivers/gpu/drm/i915/i915_request.h        | 4 ++--
 drivers/leds/leds-pwm.c                    | 2 +-
 drivers/soc/aspeed/aspeed-lpc-snoop.c      | 4 ++--
 include/drm/drm_gem.h                      | 2 +-
 include/linux/list_sort.h                  | 4 ++--
 include/linux/string.h                     | 2 +-
 include/linux/xarray.h                     | 4 ++--
 lib/list_sort.c                            | 6 +++---
 scripts/checkpatch.pl                      | 3 +++
 tools/include/linux/compiler.h             | 4 ++++
 tools/lib/python/kdoc/xforms_lists.py      | 1 +
 13 files changed, 25 insertions(+), 17 deletions(-)

base-commit: 6b4b543fa18757297ac756a6fe6e64f506b7844a

Signature · 1 line
2.53.0-Meta