]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kselftest/arm64: mte: fix printf type warnings about __u64
authorAndre Przywara <andre.przywara@arm.com>
Fri, 16 Aug 2024 15:32:49 +0000 (16:32 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 17 Oct 2024 17:54:17 +0000 (18:54 +0100)
commit7e893dc81de3e342156389ea0b83ec7d07f25281
treec0bf15c724aca3b5ad74355b3e36aa954382191f
parent0f995f22a03fef8f3bff51d22a0a78c768536814
kselftest/arm64: mte: fix printf type warnings about __u64

When printing the signal context's PC, we use a "%lx" format specifier,
which matches the common userland (glibc's) definition of uint64_t as an
"unsigned long". However the structure in question is defined in a
kernel uapi header, which uses a self defined __u64 type, and the arm64
kernel headers define this using "int-ll64.h", so it becomes an
"unsigned long long". This mismatch leads to the usual compiler warning.

The common fix would be to use "PRIx64", but because this is defined by
the userland's toolchain libc headers, it wouldn't match as well. Since
we know the exact type of __u64, just use "%llx" here instead, to silence
this warning.

This also fixes a more severe typo: "$lx" is not a valid format
specifier.

Fixes: 191e678bdc9b ("kselftest/arm64: Log unexpected asynchronous MTE faults")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240816153251.2833702-7-andre.przywara@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/mte/mte_common_util.c