Skip to contentSkip to conversation

x86/insn: Fix linux/unaligned.h include path

PATCH Applied Ian Rogers 3 participants 5 messages Feb 25, 2025 – Feb 28, 2025

lore
Share & tools
lore

Ian Rogers

author
#0 lore raw

PATCH 1/1 x86/insn: Fix linux/unaligned.h include path

tools/arch/x86/include/linux doesn't exist but building is working by virtue of a -I. Building using bazel this fails. Use angle brackets to include unaligned.h so there isn't an invalid relative include.

Fixes 5f60d5f6bbc1 ("move asm/unaligned.h to linux/unaligned.h")
---
 tools/arch/x86/lib/insn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/arch/x86/lib/insn.c +1 -1
index ab5cdc3337da..e91d4c4e1c16 100644
@@ -13,7 +13,7 @@
 #endif
 #include "../include/asm/inat.h" /* __ignore_sync_check__ */
 #include "../include/asm/insn.h" /* __ignore_sync_check__ */
-#include "../include/linux/unaligned.h" /* __ignore_sync_check__ */
+#include <linux/unaligned.h> /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
Signature · 1 line
2.48.1.711.g2feabab25a-goog
#1 lore raw
Quoted 3 lines · Ian Rogers

tools/arch/x86/include/linux doesn't exist but building is working by virtue of a -I. Building using bazel this fails. Use angle brackets to include unaligned.h so there isn't an invalid relative include.

Right, it's using tools/include/linux/unaligned.h.

Thanks,
Namhyung

Quoted 23 lines
Fixes 5f60d5f6bbc1 ("move asm/unaligned.h to linux/unaligned.h")
---
 tools/arch/x86/lib/insn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/arch/x86/lib/insn.c +1 -1
index ab5cdc3337da..e91d4c4e1c16 100644
@@ -13,7 +13,7 @@
 #endif
 #include "../include/asm/inat.h" /* __ignore_sync_check__ */
 #include "../include/asm/insn.h" /* __ignore_sync_check__ */
-#include "../include/linux/unaligned.h" /* __ignore_sync_check__ */
+#include <linux/unaligned.h> /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
Signature · 1 line
2.48.1.711.g2feabab25a-goog
#2 lore raw

Adding Josh and Peter as it's used in objtool as well.

Quoted 6 lines · Namhyung Kim
Quoted 3 lines · Ian Rogers

tools/arch/x86/include/linux doesn't exist but building is working by virtue of a -I. Building using bazel this fails. Use angle brackets to include unaligned.h so there isn't an invalid relative include.

Right, it's using tools/include/linux/unaligned.h.

Josh, are you ok with this? I can carry this in the perf tools tree if you don't mind.

Thanks,
Namhyung

Quoted 24 lines
Quoted 24 lines
Fixes 5f60d5f6bbc1 ("move asm/unaligned.h to linux/unaligned.h")
---
 tools/arch/x86/lib/insn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/arch/x86/lib/insn.c +1 -1
index ab5cdc3337da..e91d4c4e1c16 100644
@@ -13,7 +13,7 @@
 #endif
 #include "../include/asm/inat.h" /* __ignore_sync_check__ */
 #include "../include/asm/insn.h" /* __ignore_sync_check__ */
-#include "../include/linux/unaligned.h" /* __ignore_sync_check__ */
+#include <linux/unaligned.h> /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
Signature · 1 line
2.48.1.711.g2feabab25a-goog
#3 lore raw
Quoted 4 lines · Namhyung Kim

Adding Josh and Peter as it's used in objtool as well.

Quoted 1 line · Namhyung Kim

On Tue, Feb 25, 2025 at 11:36:00AM -0800, Ian Rogers wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

tools/arch/x86/include/linux doesn't exist but building is working by virtue of a -I. Building using bazel this fails. Use angle brackets to include unaligned.h so there isn't an invalid relative include.

Right, it's using tools/include/linux/unaligned.h.

Josh, are you ok with this? I can carry this in the perf tools tree if you don't mind.

LGTM

Signature · 1 line
Josh
Applied
#4 lore raw
In reply to Ian Rogers
Quoted 5 lines · Ian Rogers

tools/arch/x86/include/linux doesn't exist but building is working by virtue of a -I. Building using bazel this fails. Use angle brackets to include unaligned.h so there isn't an invalid relative include.

Applied to perf-tools-next, thanks!

Best regards,
Namhyung