From nobody Tue Sep 29 06:09:18 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 DBF6E400E18; Tue, 11 Aug 2026 16:14:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786464854; cv=none; b=ETDIVtOuAEFHSggyHEDY1pBCc8mIhGKIqEn/JI4aBKrnifKXhXMpLafPkw4LXm+gmG+2TdlQ4tiTyQqrnaTVHe0H3JblIkKszUAdAejyOJqq0e7fvBFrrkpGcWs7OyYLma5JWNyUUJYdz19Y994CGCEkGWPHtvGAHw+8486DVeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786464854; c=relaxed/simple; bh=V57Z6yiNmoXr8UZqHKEftAseyydt1TvsfIY9FX+PpRk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=rnVj0diOjgP5ZqGy2bEQpA6yJUhnCWdQB1Xuffu29HKPYe68aKs06b/KiHimA35Ngn4w74KNza/ymh+05xxzZuYuAMJNx6VA0h32sAj9ekVk/nq6EuuMkDFMO0JE0Wvb7oG0wAzeThqxNJt2DFqr3B9aNold9n1gmIs3fkb9BME= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sTS1F18L; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7D8Bt4Ge; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sTS1F18L"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7D8Bt4Ge" Date: Tue, 11 Aug 2026 16:14:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1786464850; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Pl8DykR3SUAkgZum12NyVljsC71i0xhUdn/2rSqP4o=; b=sTS1F18LVe52fpm87ClcbIiidNpqd0/O1EUakvPTq+KERLKHzytHrum+ZEondUeoC+UWtO lWLNSGEBRtCHyskFTkfdDfeIcR8GgJods1dU0BpSdtlQjkt5FEQ7Rtrfv0rErusTxKXqtt gSGChcwVkXB11FcgPFB4C0gQZRBQNAPZ9JRCaHwNYGJYv4AqY+NHKQpY2I+gBIFSoSuyMw 1ZJ2lR7NgiwE7E55g+7qeMc0e2cZu2ahySLg7OM4SOXawE07FkXwdbiEQpgZZ8XaoSUe9/ QethEb+iw5RnqITatdyoPlo0LmkzOknTAkx3KUd7xrcnTT5L6y1/6rpH8EQE3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1786464850; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Pl8DykR3SUAkgZum12NyVljsC71i0xhUdn/2rSqP4o=; b=7D8Bt4GewZi4r3/5cBVjpXXkoSikdiorMjDCd3+KollDpv167bQzxmQHlGrjJvVdNbv7vc rlS4iuRkNAx4C1Aw== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh_=28Schneider_Electric=29?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] selftests: timers: nanosleep: Reuse kselftest error numbers Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , John Stultz , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260803-auxclock-nanosleep-prep-v2-10-910cbd485390@linutronix.de> References: <20260803-auxclock-nanosleep-prep-v2-10-910cbd485390@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178646484926.442315.12694355977275032537.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/core branch of tip: Commit-ID: bfe5bf0c5fab93f90d851688fe2d65590339ecec Gitweb: https://git.kernel.org/tip/bfe5bf0c5fab93f90d851688fe2d65590= 339ecec Author: Thomas Wei=C3=9Fschuh (Schneider Electric) AuthorDate: Mon, 03 Aug 2026 12:04:41 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 11 Aug 2026 18:11:20 +02:00 selftests: timers: nanosleep: Reuse kselftest error numbers The test currently defines its own custom error numbers. These mirror the semantics from the standard KFST_* constants. To make the code easier to read, use the standard result constants. Signed-off-by: Thomas Wei=C3=9Fschuh (Schneider Electric) Signed-off-by: Thomas Gleixner Acked-by: John Stultz Link: https://patch.msgid.link/20260803-auxclock-nanosleep-prep-v2-10-910cb= d485390@linutronix.de --- tools/testing/selftests/timers/nanosleep.c | 36 +++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/timers/nanosleep.c b/tools/testing/sel= ftests/timers/nanosleep.c index 9dd6622..0a2ca17 100644 --- a/tools/testing/selftests/timers/nanosleep.c +++ b/tools/testing/selftests/timers/nanosleep.c @@ -30,8 +30,6 @@ #include "clock-helpers.h" #include "kselftest.h" =20 -#define UNSUPPORTED 0xf00f - /* returns 1 if a <=3D b, 0 otherwise */ static inline int in_order(struct timespec a, struct timespec b) { @@ -60,15 +58,15 @@ int nanosleep_test(int clockid, long long ns) =20 /* First check abs time */ if (clock_gettime(clockid, &now)) - return UNSUPPORTED; + return KSFT_SKIP; target =3D timespec_add(now, ns); =20 if (clock_nanosleep(clockid, TIMER_ABSTIME, &target, NULL)) - return UNSUPPORTED; + return KSFT_SKIP; clock_gettime(clockid, &now); =20 if (!in_order(target, now)) - return -1; + return KSFT_FAIL; =20 /* Second check reltime */ clock_gettime(clockid, &now); @@ -80,8 +78,8 @@ int nanosleep_test(int clockid, long long ns) clock_gettime(clockid, &now); =20 if (!in_order(target, now)) - return -1; - return 0; + return KSFT_FAIL; + return KSFT_PASS; } =20 static void dummy_event_handler(int val) @@ -100,38 +98,38 @@ static int nanosleep_test_remaining(int clockid) sa.sa_handler =3D dummy_event_handler; ret =3D sigaction(SIGALRM, &sa, NULL); if (ret) - return -1; + return KSFT_FAIL; =20 ret =3D timer_create(clockid, NULL, &timer); if (ret) - return -1; + return KSFT_FAIL; =20 itimer.it_value.tv_nsec =3D NSEC_PER_SEC / 4; ret =3D timer_settime(timer, 0, &itimer, NULL); if (ret) - return -1; + return KSFT_FAIL; =20 rqtp.tv_nsec =3D NSEC_PER_SEC / 2; ret =3D clock_nanosleep(clockid, 0, &rqtp, &rmtp); if (ret !=3D EINTR) - return -1; + return KSFT_FAIL; =20 ret =3D timer_delete(timer); if (ret) - return -1; + return KSFT_FAIL; =20 sa.sa_handler =3D SIG_DFL; ret =3D sigaction(SIGALRM, &sa, NULL); if (ret) - return -1; + return KSFT_FAIL; =20 if (!in_order((struct timespec) {}, rmtp)) - return -1; + return KSFT_FAIL; =20 if (!in_order(rmtp, rqtp)) - return -1; + return KSFT_FAIL; =20 - return 0; + return KSFT_PASS; } =20 int main(int argc, char **argv) @@ -159,18 +157,18 @@ int main(int argc, char **argv) length =3D 10; while (length <=3D (NSEC_PER_SEC * 10)) { ret =3D nanosleep_test(clockid, length); - if (ret =3D=3D UNSUPPORTED) { + if (ret =3D=3D KSFT_SKIP) { ksft_test_result_skip("%s\n", clock_name(clockid)); goto next; } - if (ret < 0) { + if (ret =3D=3D KSFT_FAIL) { ksft_test_result_fail("%s\n", clock_name(clockid)); ksft_exit_fail(); } length *=3D 100; } ret =3D nanosleep_test_remaining(clockid); - if (ret < 0) { + if (ret =3D=3D KSFT_FAIL) { ksft_test_result_fail("%s\n", clock_name(clockid)); ksft_exit_fail(); }