mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
LinuxKPI: Implement dev_dbg_once() macro
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42795
(cherry picked from commit a012599653)
This commit is contained in:
parent
1341925217
commit
8291858235
1 changed files with 8 additions and 0 deletions
|
|
@ -235,6 +235,14 @@ show_class_attr_string(struct class *class,
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#define dev_dbg_once(dev, ...) do { \
|
||||
static bool __dev_dbg_once; \
|
||||
if (!__dev_dbg_once) { \
|
||||
__dev_dbg_once = 1; \
|
||||
dev_dbg(dev, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define dev_err_ratelimited(dev, ...) do { \
|
||||
static linux_ratelimit_t __ratelimited; \
|
||||
if (linux_ratelimited(&__ratelimited)) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue