[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210512184850.3526677-1-Liam.Howlett@Oracle.com>
Date: Wed, 12 May 2021 18:48:52 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Matthew Wilcox <willy@...radead.org>
CC: Liam Howlett <liam.howlett@...cle.com>
Subject: [PATCH 1/4] radix tree test suite: Add support for fallthrough
attribute
Add support for fallthrough on case statements. Note this does *NOT*
check for missing fallthrough, but does allow compiling of code with
fallthrough in case statements.
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
tools/testing/radix-tree/linux/kernel.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h
index 39867fd80c8f..c400a27e544a 100644
--- a/tools/testing/radix-tree/linux/kernel.h
+++ b/tools/testing/radix-tree/linux/kernel.h
@@ -23,4 +23,11 @@
#define __must_hold(x)
#define EXPORT_PER_CPU_SYMBOL_GPL(x)
+
+#if __has_attribute(__fallthrough__)
+# define fallthrough __attribute__((__fallthrough__))
+#else
+# define fallthrough do {} while (0) /* fallthrough */
+#endif /* __has_attribute */
+
#endif /* _KERNEL_H */
--
2.30.2
Powered by blists - more mailing lists