The kernel userspace headers for Linux 7.0 provide the __counted_by_ptr
macro, so we shouldn't define it separately on those platforms:
In file included from radix-tree.c:11:
../include/platform_defs.h:334:9: error: "__counted_by_ptr" redefined [-Werror]
334 | #define __counted_by_ptr(member)
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/linux/posix_types.h:5,
from /usr/include/linux/types.h:9,
from /usr/include/linux/sched/types.h:5,
from /usr/include/x86_64-linux-gnu/bits/sched.h:63,
from /usr/include/sched.h:43,
from /usr/include/pthread.h:22,
from ../include/platform_defs.h:19:
/usr/include/linux/stddef.h:73:9: note: this is the location of the previous definition
73 | #define __counted_by_ptr(m)
| ^~~~~~~~~~~~~~~~
Do the customary ifndef wrapper thing.
Cc: linux-xfs@vger.kernel.org # v7.0.0
Fixes: df91bc3bdc9b81 ("xfs: annotate struct xfs_attr_list_context with __counted_by_ptr")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
#endif
/* xfs_attr.h */
+#ifndef __counted_by_ptr
#define __counted_by_ptr(member)
+#endif
#endif /* __XFS_PLATFORM_DEFS_H__ */