mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/2] include: ktime: move ktime_t definition globally
@ 2026-05-03  8:23 Ahmad Fatoum
  2026-05-03  8:23 ` [PATCH v2 2/2] readkey: handle standalone ESC keypress with timeout Ahmad Fatoum
  2026-05-07 11:19 ` [PATCH v2 1/2] include: ktime: move ktime_t definition globally Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2026-05-03  8:23 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

To allow use of the type without including the ktime.h header, define it
in linux/types.h. This is also where Linux defines it.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
v1 -> v2:
  - no change
---
 include/linux/ktime.h | 4 +---
 include/linux/types.h | 3 +++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 2b9a91d5401c..483324a4444f 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -21,6 +21,7 @@
 #ifndef _LINUX_KTIME_H
 #define _LINUX_KTIME_H
 
+#include <linux/types.h>
 #include <linux/math.h>
 #include <linux/time.h>
 #include <clock.h>
@@ -31,9 +32,6 @@
 #define KTIME_SEC_MAX			(KTIME_MAX / NSEC_PER_SEC)
 #define KTIME_SEC_MIN			(KTIME_MIN / NSEC_PER_SEC)
 
-/* Nanosecond scalar representation for kernel time values */
-typedef s64	ktime_t;
-
 /**
  * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value
  * @secs:	seconds to set
diff --git a/include/linux/types.h b/include/linux/types.h
index 93e7fe46295f..6731b5a1b246 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -120,6 +120,9 @@ typedef		__u64		u_int64_t;
 typedef		__s64		int64_t;
 #endif
 
+/* Nanosecond scalar representation for kernel time values */
+typedef s64	ktime_t;
+
 #endif /* __KERNEL_STRICT_NAMES */
 
 /*
-- 
2.47.3




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

end of thread, other threads:[~2026-05-07 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-03  8:23 [PATCH v2 1/2] include: ktime: move ktime_t definition globally Ahmad Fatoum
2026-05-03  8:23 ` [PATCH v2 2/2] readkey: handle standalone ESC keypress with timeout Ahmad Fatoum
2026-05-07 11:19 ` [PATCH v2 1/2] include: ktime: move ktime_t definition globally Sascha Hauer

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