[PATCH 7/9] include: Upgrade <linux/typecheck.h>

Pierre-Clément Tosi ptosi at google.com
Wed Mar 16 16:39:46 CET 2022


Upgrade the header to version 5.16 of the kernel:

    commit df0cc57e057f18e44dac8e6c18aba47ab53202f9

Signed-off-by: Pierre-Clément Tosi <ptosi at google.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Tom Rini <trini at konsulko.com>
---
 include/linux/typecheck.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/typecheck.h b/include/linux/typecheck.h
index eb5b74a575..46b15e2aae 100644
--- a/include/linux/typecheck.h
+++ b/include/linux/typecheck.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef TYPECHECK_H_INCLUDED
 #define TYPECHECK_H_INCLUDED
 
@@ -21,4 +22,13 @@
 	(void)__tmp; \
 })
 
+/*
+ * Check at compile time that something is a pointer type.
+ */
+#define typecheck_pointer(x) \
+({	typeof(x) __dummy; \
+	(void)sizeof(*__dummy); \
+	1; \
+})
+
 #endif		/* TYPECHECK_H_INCLUDED */
-- 
2.35.1.723.g4982287a31-goog



More information about the U-Boot mailing list