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

From: Randy Dunlap

Date: Wed Oct 28 2026 - 16:46:16 EST




On 10/28/26 1:19 AM, Dmitry Ilvokhin wrote:
> 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.

What ARCH(es)?

Did you mean to use such an "old" version of GCC?

thanks.

>
> [1]: https://lore.kernel.org/all/20261019175633.415493-19-bvanassche@xxxxxxx/
>
> 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

--
~Randy