[PATCH v2 01/11] tools compiler.h: fix __used definition

Benjamin Berg
2025-09-19T15:36:04Z

From: Benjamin Berg <benjamin.berg@intel.com>

The define mapped to __attribute__((__unused__)) instead of using
__used__. Having the wrong definition here may result in the linker
incorrectly removing the symbol. Also, this now matches the definition
in include/linux/compiler_attributes.h.

Fixes: e58e871becec ("tools/lib/lockdep: Remove private kernel headers")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/include/linux/compiler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 33411ca0cc90..b2c40621d441 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -127,7 +127,7 @@
#endif

#ifndef __used
-# define __used __attribute__((__unused__))
+# define __used __attribute__((__used__))
#endif

#ifndef __packed
--
2.51.0