[Concept,15/16] ext4l: Move WARN_RATELIMIT to linux/ratelimit.h
Commit Message
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(-)
@@ -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 */
@@ -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 */