git: 01bb12ee7193 - stable/15 - linuxkpi: Add WARN_RATELIMIT()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Apr 2026 21:08:17 UTC
The branch stable/15 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=01bb12ee7193861f9026d941097eb6c239c92fe3
commit 01bb12ee7193861f9026d941097eb6c239c92fe3
Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2025-08-12 23:14:52 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-04-22 20:56:57 +0000
linuxkpi: Add WARN_RATELIMIT()
The i915 DRM driver started to use it in Linux 6.10.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54493
(cherry picked from commit 3942e85b992138056841cd7c96ea20436a66b740)
---
sys/compat/linuxkpi/common/include/linux/ratelimit.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/compat/linuxkpi/common/include/linux/ratelimit.h b/sys/compat/linuxkpi/common/include/linux/ratelimit.h
index 9585b4b994d7..fdef57c7882d 100644
--- a/sys/compat/linuxkpi/common/include/linux/ratelimit.h
+++ b/sys/compat/linuxkpi/common/include/linux/ratelimit.h
@@ -14,4 +14,11 @@ struct ratelimit_state {
#define ratelimit_state_init(x, y, z)
#define ratelimit_set_flags(x, y)
+#define WARN_RATELIMIT(condition, ...) ({ \
+ bool __ret_warn_on = (condition); \
+ if (unlikely(__ret_warn_on)) \
+ pr_warn_ratelimited(__VA_ARGS__); \
+ unlikely(__ret_warn_on); \
+})
+
#endif