From: Liam R. Howlett Date: Mon, 27 Jul 2020 19:28:58 +0000 (-0400) Subject: radix tree test suite: Add support for fallthrough attribute X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=12cb0fac6cf4b95c7b1a98fb1a124de2bdcf7f05;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h index c5c9d05f29da..99979aeaa379 100644 --- a/tools/testing/radix-tree/linux/kernel.h +++ b/tools/testing/radix-tree/linux/kernel.h @@ -24,4 +24,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 */