From nobody Sun Dec 24 08:22:56 2023
X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SyYv51Yhpz54HPk;
	Sun, 24 Dec 2023 08:22:57 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4SyYv45J4Qz4XfN;
	Sun, 24 Dec 2023 08:22:56 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1703406176;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=TlX+hLNM0VjzyHHnwjDOthJnQMAonECM5LRk3Nme7xM=;
	b=pqmMVvO+kOIFO79p7KaAmOWCuuLps8mM6vJiGOQ7WdcV+XKRIgAoo9mLQChm4dE/GpTgP6
	OdFcLdRZJiHyBtlQZN5asCzzn/aE5hWsrZkMgneiLKJs2eDWxjw14STxOwl40cWk9H6H3e
	0gybEfAVWvnrxVUWTJKp3skDBkH13qjDle7aXF1JKMisXy9HTDVU7Quwceor1hkyB2ROuu
	wTnylGoY2hKPjRDesfLTwehtQFGTG4XENC6Qm3vJloxTwg3bDuH1MOQP39OpDYE6A2Oocz
	UC4CkTZ0bi/O23Jf7IVzYs7U62HaRkVnM5MM5YEluCma0svFuL0xpbeEBLn7qw==
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703406176; a=rsa-sha256; cv=none;
	b=L3E3s0EFhjWsMuYAKVvGb4Bu3jOnjr2Gh3EY9Sr/fEfEuE9NdgL/yuTRSvooFk/8UP1MCN
	MPKtw60LKOFJq3wdAfxjBR9Ghun/QUWpdQUNIf6yokUxZwoMka7P1SEGmpXAIEY9OQr1IA
	VjCaz4N3DMFRSo4fh0YFgB7VVThLOEznBsaONdVmr1r/aXnmVf6ZzRi2y3TCb//TK2t32o
	MHO6oV6UCLbtkDsNFO4adnoN4iCtmAzX4ZXrSHZhuIx3CdKtZ7NXI+mjl69p6Qx+XQnD6D
	+FuN6+9ou9gubR6fXe0MMLCvCR9X6fSQ5kTKEbBlJGa9qiIfz+VUKah30Wq8Hg==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1703406176;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=TlX+hLNM0VjzyHHnwjDOthJnQMAonECM5LRk3Nme7xM=;
	b=wCEyQsWQezoIywJ7WI/mx98c/ynAt82pWu+pNBPGZGHwwB7de7j0mW5b6M4MfSoYNZWgqz
	z4sZi6MAKzL+byJez+ibHQGDIKoQZKzWkuKpdFFfovpu8pwMVtUFtPmzzgJcxRSx5WpHkB
	+efoQviJh+XtMX7Qj9FfU4y3L2CWV8phQBlYJRmpF4GLtrUiJNWFyYUhgZ21/Bwcyupqe1
	SfhvO1pOdsULCYH9rITITJuYnwmVzvlKGjuMo3PmO6tfziMjTxDBaXHD0M5YNhsNUOzKMe
	eqM89gyKA0KGeaCG1g1KbuhFYctCHnkbIJXO3OHMJUXhhHD6HvvetrLcJNfB2g==
Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SyYv44PTRz5tG;
	Sun, 24 Dec 2023 08:22:56 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from gitrepo.freebsd.org ([127.0.1.44])
	by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BO8Mu90086567;
	Sun, 24 Dec 2023 08:22:56 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BO8MuRC086564;
	Sun, 24 Dec 2023 08:22:56 GMT
	(envelope-from git)
Date: Sun, 24 Dec 2023 08:22:56 GMT
Message-Id: <202312240822.3BO8MuRC086564@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-main@FreeBSD.org
From: Vladimir Kondratyev <wulf@FreeBSD.org>
Subject: git: a01259965319 - main - LinuxKPI: Implement dev_dbg_once()
  macro
List-Id: Commit messages for the main branch of the src repository <dev-commits-src-main.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main
List-Help: <mailto:dev-commits-src-main+help@freebsd.org>
List-Post: <mailto:dev-commits-src-main@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-main+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-main+unsubscribe@freebsd.org>
Sender: owner-dev-commits-src-main@freebsd.org
X-BeenThere: dev-commits-src-main@freebsd.org
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Git-Committer: wulf
X-Git-Repository: src
X-Git-Refname: refs/heads/main
X-Git-Reftype: branch
X-Git-Commit: a01259965319897b836019f1d4dcf1b5a5a6ea1a
Auto-Submitted: auto-generated

The branch main has been updated by wulf:

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

commit a01259965319897b836019f1d4dcf1b5a5a6ea1a
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2023-12-24 08:19:58 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2023-12-24 08:19:58 +0000

    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
---
 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 7a5d813063a9..142003c5ca8c 100644
--- a/sys/compat/linuxkpi/common/include/linux/device.h
+++ b/sys/compat/linuxkpi/common/include/linux/device.h
@@ -236,6 +236,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))	\