mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 15:40:03 +02:00
selftests/powerpc: use MAP_FAILED instead of (void *)-1 in tm-signal-context-force-tm
mmap() is documented to return MAP_FAILED on error, but tm-signal-context-force-tm.c compares the return value against (void *)-1. Replace these with the standard MAP_FAILED macro for better readability and type safety. Signed-off-by: longlong yan <yanlonglong@kylinos.cn> Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260722023428.932-1-yanlonglong@kylinos.cn
This commit is contained in:
parent
e58b9d9097
commit
bf1d828781
|
|
@ -60,7 +60,7 @@ void usr_signal_handler(int signo, siginfo_t *si, void *uc)
|
|||
ucp->uc_link = mmap(NULL, sizeof(ucontext_t),
|
||||
PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
|
||||
if (ucp->uc_link == (void *)-1) {
|
||||
if (ucp->uc_link == MAP_FAILED) {
|
||||
perror("Mmap failed");
|
||||
exit(-1);
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ void tm_trap_test(void)
|
|||
ss.ss_size = SIGSTKSZ;
|
||||
ss.ss_flags = 0;
|
||||
|
||||
if (ss.ss_sp == (void *)-1) {
|
||||
if (ss.ss_sp == MAP_FAILED) {
|
||||
perror("mmap error\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user