[Concept,15/16] ext4l: Move WARN_RATELIMIT to linux/ratelimit.h

Message ID 20260119214846.3087611-16-sjg@u-boot.org
State New
Headers
Series ext4l: Move definitions to standard Linux headers |

Commit Message

Simon Glass Jan. 19, 2026, 9:48 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move the WARN_RATELIMIT macro to include/linux/ratelimit.h where it
belongs with other rate-limiting definitions.

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

 fs/ext4l/ext4_uboot.h     | 3 +--
 include/linux/ratelimit.h | 9 +++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index e617fc41e30..49405877133 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -1329,8 +1329,7 @@  static inline unsigned long ext4_find_next_bit_le(const void *addr,
 
 /* sb_end_intwrite defined earlier */
 
-/* WARN_RATELIMIT - just evaluate condition, no warning in U-Boot */
-#define WARN_RATELIMIT(condition, ...) (condition)
+/* WARN_RATELIMIT is in linux/ratelimit.h */
 
 /* folio_get - now implemented in support.c */
 
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 319f794f059..ca42c21406a 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -32,4 +32,13 @@  struct ratelimit_state {
 int ___ratelimit(struct ratelimit_state *rs, const char *func);
 void ratelimit_state_init(void *rs, int interval, int burst);
 
+/**
+ * WARN_RATELIMIT - conditionally emit warning with rate limiting
+ * @condition: condition to check
+ * @...: printf-style format and arguments
+ *
+ * In U-Boot (no rate limiting), just evaluates the condition.
+ */
+#define WARN_RATELIMIT(condition, ...)	(condition)
+
 #endif /* _LINUX_RATELIMIT_H */