From 0ed11aa9a4b4c627ed98620026b23f8bb86afd5a Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Mon, 27 Apr 2020 21:17:56 +0100 Subject: [PATCH] compatibility - fallthrough' pseudo keyword was introduced in v5.4 commit 294f69e662d1570703e9b56e95be37a9fd3afba5 Author: Joe Perches Date: Sat Oct 5 09:46:42 2019 -0700 compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use --- sound-compatible-4.18.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound-compatible-4.18.h b/sound-compatible-4.18.h index dc5a787..faed848 100644 --- a/sound-compatible-4.18.h +++ b/sound-compatible-4.18.h @@ -15,6 +15,14 @@ #define __NO_SND_SOC_CODEC_DRV 0 #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) +#if __has_attribute(__fallthrough__) +# define fallthrough __attribute__((__fallthrough__)) +#else +# define fallthrough do {} while (0) /* fallthrough */ +#endif +#endif + #if __NO_SND_SOC_CODEC_DRV #define codec component #define snd_soc_codec snd_soc_component