[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251209121701.1856271-8-hca@linux.ibm.com>
Date: Tue, 9 Dec 2025 13:16:59 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Alexander Gordeev <agordeev@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Mark Rutland <mark.rutland@....com>, Arnd Bergmann <arnd@...db.de>,
Jens Remus <jremus@...ux.ibm.com>,
Stefan Schulze Frielinghaus <stefansf@...ux.ibm.com>,
Juergen Christ <jchrist@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org
Subject: [PATCH 7/9] s390/bug: Implement WARN_ONCE()
This is the s390 variant of commit 11bb4944f014 ("x86/bug: Implement
WARN_ONCE()").
Signed-off-by: Heiko Carstens <hca@...ux.ibm.com>
---
arch/s390/include/asm/bug.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index f3aca691bae2..e6e8b492c0e7 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -104,6 +104,17 @@ do { \
#define __WARN_printf(taint, fmt, arg...) \
__WARN_print_arg(BUGFLAG_TAINT(taint), fmt, ## arg)
+#define WARN_ONCE(cond, format, arg...) \
+({ \
+ int __ret_warn_on = !!(cond); \
+ \
+ if (unlikely(__ret_warn_on)) { \
+ __WARN_print_arg(BUGFLAG_ONCE|BUGFLAG_TAINT(TAINT_WARN),\
+ format, ## arg); \
+ } \
+ __ret_warn_on; \
+})
+
#define HAVE_ARCH_BUG
#define HAVE_ARCH_BUG_FORMAT
#define HAVE_ARCH_BUG_FORMAT_ARGS
--
2.51.0
Powered by blists - more mailing lists