From nobody Sat Jul 25 00:02:58 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 340EA311977; Wed, 22 Jul 2026 02:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784687697; cv=none; b=ciYEtolkS9KD4qcEKHTg0HQ7/kb0XSoO3HuMOw0nm6+7yEQYSXvAhzRvtrqV4t4YO5LZn75SD4FjrDbp6ih9SAzG67BE9Akt0Q5ROx7AGIIAIzgRe8JNyhqnRWtiJMdJdLepY6jHyIf3eMXpx6IAlvvZy5w+B5nJelMa9n4tI1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784687697; c=relaxed/simple; bh=As9tJFCuNGzaU47/HbWu58XQNL1MVxFersjcm1rrKxw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Aq4pTBYWu9vgogXWcDkmnvsYTWhcCijl/cUvzrCiUPAfyUJihOIkXRs12K0JpMVlMcGAblifvJhTa8z3cqRjLvK9hC7pA1dEgb5Ty5kZ23XBRkfYVgliWFnh1OkOuNvb7/iwmQ5u12drO0EzEeLyMZLk/q0qy74l21MisLThhoc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: e4b83c7e857511f1aa26b74ffac11d73-20260722 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:f14f1e8c-c6f0-4d5e-a659-c56a11c2bc67,IP:0,U RL:0,TC:0,Content:0,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:25 X-CID-META: VersionHash:e7bac3a,CLOUDID:034ad1efaf0e8d13b9263c7cd7dd0407,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|136|850|865|898,TC:nil,Content:0|15| 50,EDM:5,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0, OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: e4b83c7e857511f1aa26b74ffac11d73-20260722 X-User: yanlonglong@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 2083707242; Wed, 22 Jul 2026 10:34:42 +0800 From: longlong yan To: maddy@linux.ibm.com, mpe@ellerman.id.au Cc: npiggin@gmail.com, chleroy@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, linux-kernel@vger.kernel.org, longlong yan Subject: [PATCH] selftests/powerpc: use MAP_FAILED instead of (void *)-1 in tm-signal-context-force-tm Date: Wed, 22 Jul 2026 10:34:28 +0800 Message-ID: <20260722023428.932-1-yanlonglong@kylinos.cn> X-Mailer: git-send-email 2.47.1.windows.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Amit Machhiwal --- .../testing/selftests/powerpc/tm/tm-signal-context-force-tm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.= c b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c index 0a4bc479ae39..5dc0f12f467d 100644 --- a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c +++ b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c @@ -60,7 +60,7 @@ void usr_signal_handler(int signo, siginfo_t *si, void *u= c) ucp->uc_link =3D mmap(NULL, sizeof(ucontext_t), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); - if (ucp->uc_link =3D=3D (void *)-1) { + if (ucp->uc_link =3D=3D MAP_FAILED) { perror("Mmap failed"); exit(-1); } @@ -129,7 +129,7 @@ void tm_trap_test(void) ss.ss_size =3D SIGSTKSZ; ss.ss_flags =3D 0; =20 - if (ss.ss_sp =3D=3D (void *)-1) { + if (ss.ss_sp =3D=3D MAP_FAILED) { perror("mmap error\n"); exit(-1); } --=20 2.43.0