git: 75b9d19c62a1 - main - linuxkpi: Define `for_each_if()`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Wed, 09 Sep 2026 20:01:17 UTC
The branch main has been updated by dumbbell:

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

commit 75b9d19c62a148a30859f9a2dc47ffa14e9d644f
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-09-09 19:37:48 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-09-09 19:37:48 +0000

    linuxkpi: Define `for_each_if()`
    
    This macro was moved from <drm/drm_util.h> to <linux/util_macros.h> in
    Linux 6.15.
    
    Submitted by:   Sourojeet Adhikari
    Approved by:    adrian, bz, emaste, seuros
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D57465
---
 sys/compat/linuxkpi/common/include/linux/util_macros.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/util_macros.h b/sys/compat/linuxkpi/common/include/linux/util_macros.h
new file mode 100644
index 000000000000..6d3e0e0729ef
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/util_macros.h
@@ -0,0 +1,18 @@
+/*-
+ * Copyright (c) 2026 The FreeBSD Foundation
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#ifndef _LINUXKPI_LINUX_UTIL_MACROS_H
+#define _LINUXKPI_LINUX_UTIL_MACROS_H
+
+/*
+ * `for_each_if()` was moved from <drm/drm_util.h> to <linux/util_macros.h> in
+ * Linux 6.15.
+ */
+#if !defined(LINUXKPI_VERSION) || (LINUXKPI_VERSION >= 61500)
+#define for_each_if(condition) if (!(condition)) {} else
+#endif
+
+#endif /* _LINUXKPI_LINUX_UTIL_MACROS_H */