[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211120130104.185699-19-alx.manpages@gmail.com>
Date: Sat, 20 Nov 2021 14:01:01 +0100
From: Alejandro Colomar <alx.manpages@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Alejandro Colomar <alx.manpages@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>,
Alexey Dobriyan <adobriyan@...il.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Kees Cook <keescook@...omium.org>,
Joe Perches <joe@...ches.com>
Subject: [PATCH v2 17/20] linux/array_size.h: Add __is_array(a) to help readability
Signed-off-by: Alejandro Colomar <alx.manpages@...il.com>
---
include/linux/array_size.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/array_size.h b/include/linux/array_size.h
index c2b4fddba564..4d364f8a1f50 100644
--- a/include/linux/array_size.h
+++ b/include/linux/array_size.h
@@ -7,7 +7,9 @@
/* &a[0] degrades to a pointer: a different type from an array */
-#define __must_be_array(a) __must_be(!__same_type((a), &(a)[0]))
+#define __is_array(a) (!__same_type((a), &(a)[0]))
+
+#define __must_be_array(a) __must_be(__is_array(a))
/**
* ARRAY_SIZE - get the number of elements in array @a
--
2.33.1
Powered by blists - more mailing lists