@@ -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 *);
@@ -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))
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 <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> --- include/linux/xarray.h | 4 ++-- tools/include/linux/compiler.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-)