Skip to contentSkip to conversation

KVM: selftests: elf: Include <endian.h> instead of <bits/endian.h>

PATCH Applied Hisam Mehboob 2 participants 3 messages Apr 9 – May 23

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: selftests: elf: Include <endian.h> instead of <bits/endian.h>

<bits/endian.h> is a glibc-internal header that explicitly states it should never be included directly:

#error "Never use <bits/endian.h> directly; include <endian.h> instead."

Replace it with the correct public header <endian.h> which works on all C libraries including musl. Building KVM selftests with musl-gcc fails with:

lib/elf.c:10:10: fatal error: bits/endian.h: No such file or directory

Fixes 6089ae0bd5e1 ("kvm: selftests: add sync_regs_test")
---
 tools/testing/selftests/kvm/lib/elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/lib/elf.c +1 -1
index f34d926d9735..620531a669cd 100644
@@ -7,7 +7,7 @@
 
 #include "test_util.h"
 
-#include <bits/endian.h>
+#include <endian.h>
 #include <linux/elf.h>
 
 #include "kvm_util.h"
Signature · 1 line
2.51.0
#1 lore raw

Gentle ping. Could I get some feedback on this patch?

Thanks,
Hisam