public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH] selftests: timers: Fix grammar and clarify comments in nanosleep.c
@ 2025-05-14 22:21 Rahul Kumar
  2025-05-22 21:52 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Rahul Kumar @ 2025-05-14 22:21 UTC (permalink / raw)
  To: skhan; +Cc: linux-kselftest, linux-kernel, linux-kernel-mentees, rk0006818

Improved the clarity and grammar in the header comment of nanosleep.c
for better readability and consistency with kernel documentation style.

Signed-off-by: Rahul Kumar <rk0006818@gmail.com>
---
 tools/testing/selftests/timers/nanosleep.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/timers/nanosleep.c b/tools/testing/selftests/timers/nanosleep.c
index 252c6308c569..84adf8a4ab5d 100644
--- a/tools/testing/selftests/timers/nanosleep.c
+++ b/tools/testing/selftests/timers/nanosleep.c
@@ -1,12 +1,12 @@
-/* Make sure timers don't return early
- *              by: john stultz (johnstul@us.ibm.com)
- *		    John Stultz (john.stultz@linaro.org)
- *              (C) Copyright IBM 2012
- *              (C) Copyright Linaro 2013 2015
- *              Licensed under the GPLv2
+ /*
+ * Ensure timers do not return early.
+ * Author: John Stultz (john.stultz@linaro.org)
+ * Copyright (C) IBM 2012
+ * Copyright (C) Linaro 2013, 2015
+ * Licensed under the GPLv2
  *
- *  To build:
- *	$ gcc nanosleep.c -o nanosleep -lrt
+ * To build:
+ *     $ gcc nanosleep.c -o nanosleep -lrt
  *
  *   This program is free software: you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -61,7 +61,7 @@ char *clockstring(int clockid)
 	case CLOCK_TAI:
 		return "CLOCK_TAI";
 	};
-	return "UNKNOWN_CLOCKID";
+	return "UNKNOWN_CLOCKID"; // Could not identify clockid
 }
 
 /* returns 1 if a <= b, 0 otherwise */
@@ -90,7 +90,7 @@ int nanosleep_test(int clockid, long long ns)
 {
 	struct timespec now, target, rel;
 
-	/* First check abs time */
+	/* First, check absolute time using clock_nanosleep with TIMER_ABSTIME */
 	if (clock_gettime(clockid, &now))
 		return UNSUPPORTED;
 	target = timespec_add(now, ns);
@@ -102,7 +102,7 @@ int nanosleep_test(int clockid, long long ns)
 	if (!in_order(target, now))
 		return -1;
 
-	/* Second check reltime */
+	/* Then, test relative time sleep */
 	clock_gettime(clockid, &now);
 	rel.tv_sec = 0;
 	rel.tv_nsec = 0;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: timers: Fix grammar and clarify comments in nanosleep.c
  2025-05-14 22:21 [PATCH] selftests: timers: Fix grammar and clarify comments in nanosleep.c Rahul Kumar
@ 2025-05-22 21:52 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2025-05-22 21:52 UTC (permalink / raw)
  To: Rahul Kumar
  Cc: linux-kselftest, linux-kernel, linux-kernel-mentees, Shuah Khan

On 5/14/25 16:21, Rahul Kumar wrote:
> Improved the clarity and grammar in the header comment of nanosleep.c
> for better readability and consistency with kernel documentation style.

This patch isn't really fixing anything. I won't be taking this one.
Sorry.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-22 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14 22:21 [PATCH] selftests: timers: Fix grammar and clarify comments in nanosleep.c Rahul Kumar
2025-05-22 21:52 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox