[PATCH v2 15/20] linux/compiler.h: Implement __must_be_array() in terms of __must_be()
From: Alejandro Colomar
Date: Sat Nov 20 2021 - 08:01:57 EST
Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx>
---
include/linux/compiler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 3d5af56337bd..64d99335874d 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -255,7 +255,7 @@ static inline void *offset_to_ptr(const int *off)
#endif /* __ASSEMBLY__ */
/* &a[0] degrades to a pointer: a different type from an array */
-#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
+#define __must_be_array(a) __must_be(!__same_type((a), &(a)[0]))
/*
* This is needed in functions which generate the stack canary, see
--
2.33.1