Commit 22302af28d3f ("cleanup: Annotate guard constructors with nonnull") added the macro __nonnull_args() to wrap raw compiler attribute. Replace __attribute__((nonnull)) with __nonnull_args() to standardize nonnull attribute usage across the tree and keep the attribute's quirks in one place rather than open-coded at every call site. tools/testing/shared/linux/xarray.h directly includes the kernel's include/linux/xarray.h, which now uses __nonnull_args(). The macro is not defined under tools/, breaking test builds. Define __nonnull_args() in tools/include/linux/compiler.h. Suggested-by: Miguel Ojeda Signed-off-by: Dmitry Ilvokhin --- include/linux/xarray.h | 4 ++-- tools/include/linux/compiler.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/xarray.h b/include/linux/xarray.h index be850174e802..cf7f8802da5b 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -361,9 +361,9 @@ bool xa_get_mark(struct xarray *, unsigned long index, xa_mark_t); void xa_set_mark(struct xarray *, unsigned long index, xa_mark_t); void xa_clear_mark(struct xarray *, unsigned long index, xa_mark_t); void *xa_find(struct xarray *xa, unsigned long *index, - unsigned long max, xa_mark_t) __attribute__((nonnull(2))); + unsigned long max, xa_mark_t) __nonnull_args(2); void *xa_find_after(struct xarray *xa, unsigned long *index, - unsigned long max, xa_mark_t) __attribute__((nonnull(2))); + unsigned long max, xa_mark_t) __nonnull_args(2); unsigned int xa_extract(struct xarray *, void **dst, unsigned long start, unsigned long max, unsigned int n, xa_mark_t); void xa_destroy(struct xarray *); diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h index 03ecf9086643..fad2c6131a80 100644 --- a/tools/include/linux/compiler.h +++ b/tools/include/linux/compiler.h @@ -68,6 +68,10 @@ #define __naked __attribute__((__naked__)) #endif +#ifndef __nonnull_args +#define __nonnull_args(x...) __attribute__((__nonnull__(x))) +#endif + /* Are two types/vars the same type (ignoring qualifiers)? */ #ifndef __same_type # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) -- 2.53.0-Meta