Skip to content

Commit 3b2d3db

Browse files
committed
KVM: selftests: Fix printf() format goof in SEV smoke test
Print out the index of mismatching XSAVE bytes using unsigned decimal format. Some versions of clang complain about trying to print an integer as an unsigned char. x86/sev_smoke_test.c:55:51: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat] Fixes: 8c53183 ("selftests: kvm: add test for transferring FPU state into VMSA") Link: https://lore.kernel.org/r/20250228233852.3855676-1-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent d88ed5f commit 3b2d3db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/kvm/x86/sev_smoke_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ static void compare_xsave(u8 *from_host, u8 *from_guest)
5252
bool bad = false;
5353
for (i = 0; i < 4095; i++) {
5454
if (from_host[i] != from_guest[i]) {
55-
printf("mismatch at %02hhx | %02hhx %02hhx\n", i, from_host[i], from_guest[i]);
55+
printf("mismatch at %u | %02hhx %02hhx\n",
56+
i, from_host[i], from_guest[i]);
5657
bad = true;
5758
}
5859
}

0 commit comments

Comments
 (0)