Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2023 22:15:03 GMT
From:      =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <dumbbell@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bbff0400c1d7 - main - linuxkpi: Define `dev_dbg_ratelimited()`
Message-ID:  <202301252215.30PMF3ED064161@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dumbbell (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=bbff0400c1d7728ae1759d8f740033a0a2f8aeff

commit bbff0400c1d7728ae1759d8f740033a0a2f8aeff
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-01-25 21:48:32 +0000

    linuxkpi: Define `dev_dbg_ratelimited()`
    
    Reviewed by:    manu
    Approved by:    manu
    Differential Revision:  https://reviews.freebsd.org/D38145
---
 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 dfe80e84cea8..92e7e6772fbd 100644
--- a/sys/compat/linuxkpi/common/include/linux/device.h
+++ b/sys/compat/linuxkpi/common/include/linux/device.h
@@ -235,6 +235,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 *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301252215.30PMF3ED064161>