Skip to content

Commit 304c464

Browse files
Leo-Yanchessturo
authored andcommitted
tools: Fix bitfield dependency failure
A perf build failure was reported by Thomas Voegtle on stable kernel v6.6.120: CC tests/sample-parsing.o CC util/intel-pt-decoder/intel-pt-pkt-decoder.o CC util/perf-regs-arch/perf_regs_csky.o CC util/arm-spe-decoder/arm-spe-pkt-decoder.o CC util/perf-regs-arch/perf_regs_loongarch.o In file included from util/arm-spe-decoder/arm-spe-pkt-decoder.h:10, from util/arm-spe-decoder/arm-spe-pkt-decoder.c:14: /local/git/linux-stable-rc/tools/include/linux/bitfield.h: In function ‘le16_encode_bits’: /local/git/linux-stable-rc/tools/include/linux/bitfield.h:166:31: error: implicit declaration of function ‘cpu_to_le16’; did you mean ‘htole16’? [-Werror=implicit-function-declaration] ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \ ^~~~~~~~~ /local/git/linux-stable-rc/tools/include/linux/bitfield.h:149:9: note: in definition of macro ‘____MAKE_OP’ return to((v & field_mask(field)) * field_multiplier(field)); \ ^~ /local/git/linux-stable-rc/tools/include/linux/bitfield.h:170:1: note: in expansion of macro ‘__MAKE_OP’ __MAKE_OP(16) Fix this by including linux/kernel.h, which provides the required definitions. The issue was not found on the mainline due to the relevant C files have included kernel.h. It'd be good to merge this change on mainline as well for robustness. Fixes: 64d86c0 ("perf arm-spe: Extend branch operations") Reported-by: Thomas Voegtle <tv@lio96.de> Closes: https://lore.kernel.org/stable/3a44500b-d7c8-179f-61f6-e51cb50d3512@lio96.de/ To: Greg KH <gregkh@linuxfoundation.org> To: Sasha Levin <sashal@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Leo Yan <leo.yan@arm.com>
1 parent d70e8f2 commit 304c464

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tools/include/linux/bitfield.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define _LINUX_BITFIELD_H
99

1010
#include <linux/build_bug.h>
11+
#include <linux/kernel.h>
1112
#include <asm/byteorder.h>
1213

1314
/*

0 commit comments

Comments
 (0)