linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] radix tree test suite: Add support for fallthrough attribute
@ 2021-05-12 18:48 Liam Howlett
  2021-05-12 18:48 ` [PATCH 2/4] radix tree test suite: Add __must_be_array() support Liam Howlett
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Liam Howlett @ 2021-05-12 18:48 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, Matthew Wilcox; +Cc: Liam Howlett

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@Oracle.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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-12 22:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 18:48 [PATCH 1/4] radix tree test suite: Add support for fallthrough attribute Liam Howlett
2021-05-12 18:48 ` [PATCH 2/4] radix tree test suite: Add __must_be_array() support Liam Howlett
2021-05-12 21:46   ` Matthew Wilcox
2021-05-12 22:13     ` Liam Howlett
2021-05-12 18:48 ` [PATCH 3/4] radix tree test suite: Add kmem_cache enhancements and pr_err Liam Howlett
2021-05-12 18:48 ` [PATCH 4/4] radix tree test suite: Add support for slab bulk APIs Liam Howlett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).