Skip to content

Commit 0cc6b94

Browse files
committed
kselftest/arm64: Fix printf() warning in the arm64 MTE prctl() test
While prctl() returns an 'int', the PR_MTE_TCF_MASK is defined as unsigned long which results in the larger type following a bitwise 'and' operation. Cast the printf() argument to 'int'. Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20241108134920.1233992-3-catalin.marinas@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent b6bd50d commit 0cc6b94

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/arm64/mte/check_prctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void set_mode_test(const char *name, int hwcap2, int mask)
8585
ksft_test_result_pass("%s\n", name);
8686
} else {
8787
ksft_print_msg("Got %x, expected %x\n",
88-
(ret & PR_MTE_TCF_MASK), mask);
88+
(ret & (int)PR_MTE_TCF_MASK), mask);
8989
ksft_test_result_fail("%s\n", name);
9090
}
9191
}

0 commit comments

Comments
 (0)