[PATCH 1/2] bugs/s390: Remove private WARN_ON() implementation

Heiko Carstens posted 2 patches 3 months, 3 weeks ago
[PATCH 1/2] bugs/s390: Remove private WARN_ON() implementation
Posted by Heiko Carstens 3 months, 3 weeks ago
Besides an odd __builtin_constant_p() optimization the s390 specific
WARN_ON() implementation is identical to the generic variant.
Drop the s390 variant in favor of the generic variant.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
 arch/s390/include/asm/bug.h | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index 837bfbde0c51..58ab4efd9dd5 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -48,20 +48,7 @@
 	__EMIT_BUG(cond_str, BUGFLAG_WARNING|(flags));	\
 } while (0)
 
-#define WARN_ON(x) ({					\
-	int __ret_warn_on = !!(x);			\
-	if (__builtin_constant_p(__ret_warn_on)) {	\
-		if (__ret_warn_on)			\
-			__WARN();			\
-	} else {					\
-		if (unlikely(__ret_warn_on))		\
-			__WARN();			\
-	}						\
-	unlikely(__ret_warn_on);			\
-})
-
 #define HAVE_ARCH_BUG
-#define HAVE_ARCH_WARN_ON
 #endif /* CONFIG_BUG */
 
 #include <asm-generic/bug.h>
-- 
2.48.1
Re: [PATCH 1/2] bugs/s390: Remove private WARN_ON() implementation
Posted by Alexander Gordeev 3 months, 3 weeks ago
On Tue, Jun 17, 2025 at 03:50:41PM +0200, Heiko Carstens wrote:
> Besides an odd __builtin_constant_p() optimization the s390 specific
> WARN_ON() implementation is identical to the generic variant.
> Drop the s390 variant in favor of the generic variant.
> 
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> ---
>  arch/s390/include/asm/bug.h | 13 -------------
>  1 file changed, 13 deletions(-)
...

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>