git: 01ae017c3e0d - stable/13 - linuxkpi: Define `dev_dbg_ratelimited()`
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Feb 2023 11:55:51 UTC
The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=01ae017c3e0da57e83982d5bd1d21bd8d4af9a4d commit 01ae017c3e0da57e83982d5bd1d21bd8d4af9a4d Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2023-01-19 00:15:03 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2023-02-16 11:55:13 +0000 linuxkpi: Define `dev_dbg_ratelimited()` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38145 (cherry picked from commit bbff0400c1d7728ae1759d8f740033a0a2f8aeff) --- sys/compat/linuxkpi/common/include/linux/device.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index bf9a0cabd066..01a1729830c4 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -233,6 +233,12 @@ show_class_attr_string(struct class *class, dev_warn(dev, __VA_ARGS__); \ } while (0) +#define dev_dbg_ratelimited(dev, ...) do { \ + static linux_ratelimit_t __ratelimited; \ + if (linux_ratelimited(&__ratelimited)) \ + dev_dbg(dev, __VA_ARGS__); \ +} while (0) + /* Public and LinuxKPI internal devres functions. */ void *lkpi_devres_alloc(void(*release)(struct device *, void *), size_t, gfp_t); void lkpi_devres_add(struct device *, void *);