[Concept,20/23] ext4l: Move scheduler stubs to linux/sched.h

Message ID 20260119061529.3383191-21-sjg@u-boot.org
State New
Headers
Series Reduce ext4_uboot.h by moving definitions to linux headers |

Commit Message

Simon Glass Jan. 19, 2026, 6:15 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move schedule_timeout_interruptible(), schedule_timeout_uninterruptible(),
and need_resched() to include/linux/sched.h where they belong with other
scheduler functions.

These are stubs since U-Boot is single-threaded.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 7 ++-----
 include/linux/sched.h | 7 +++++++
 2 files changed, 9 insertions(+), 5 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index dc6d4c3910a..206bf4d784f 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -1294,8 +1294,7 @@  void *kvzalloc(size_t size, gfp_t flags);
 #define sb_start_write(sb)		do { } while (0)
 #define sb_end_write(sb)		do { } while (0)
 
-/* Scheduler stubs */
-#define schedule_timeout_interruptible(t)	({ (void)(t); 0; })
+/* schedule_timeout_interruptible is in linux/sched.h */
 
 /* Page allocation - declarations for stub.c */
 unsigned long get_zeroed_page(gfp_t gfp);
@@ -1465,9 +1464,7 @@  static inline unsigned long ext4_find_next_bit_le(const void *addr,
 /* raw_cpu_ptr - get pointer to per-CPU data for current CPU */
 #define raw_cpu_ptr(ptr)		(ptr)
 
-/* Scheduler stubs */
-#define schedule_timeout_uninterruptible(t) do { } while (0)
-#define need_resched()			(0)
+/* schedule_timeout_uninterruptible, need_resched are in linux/sched.h */
 
 /* Block device operations */
 #define sb_find_get_block_nonatomic(sb, block) \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 04672cee991..ff36a6443c8 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -41,4 +41,11 @@  extern struct task_struct *current;
 #define signal_pending(task)	0
 #define fatal_signal_pending(task)	0
 
+/* Scheduler timeout stubs - return immediately in U-Boot */
+#define schedule_timeout_interruptible(timeout)		({ (void)(timeout); 0; })
+#define schedule_timeout_uninterruptible(timeout)	do { (void)(timeout); } while (0)
+
+/* Check if rescheduling is needed - always false in single-threaded U-Boot */
+#define need_resched()		(0)
+
 #endif /* _LINUX_SCHED_H */