Date: Fri, 11 Nov 2022 17:57:50 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: c4163160e44d - main - linuxkpi: Add `dev_warn_once()` in <linux/device.h> Message-ID: <202211111757.2ABHvoKC044981@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=c4163160e44d1f329301b0fe943854b9dc0750dc commit c4163160e44d1f329301b0fe943854b9dc0750dc Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2022-11-11 17:42:31 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2022-11-11 17:42:31 +0000 linuxkpi: Add `dev_warn_once()` in <linux/device.h> Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D36968 --- sys/compat/linuxkpi/common/include/linux/device.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index f3e2c4697562..720a2019c0f0 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -206,6 +206,14 @@ show_class_attr_string(struct class *class, } \ } while (0) +#define dev_warn_once(dev, ...) do { \ + static bool __dev_warn_once; \ + if (!__dev_warn_once) { \ + __dev_warn_once = 1; \ + dev_warn(dev, __VA_ARGS__); \ + } \ +} while (0) + #define dev_err_once(dev, ...) do { \ static bool __dev_err_once; \ if (!__dev_err_once) { \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211111757.2ABHvoKC044981>