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 <[email protected]> Cc: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent b6bd50d commit 0cc6b94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)