From 918f22c2062628342ab7317d7b60c7b3fa1fdaab Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Fri, 13 Nov 2020 14:39:57 -0800 Subject: [PATCH] dai: add fall through markers for clang for some reason the clang version with oss-fuzz doesn't recognize the comments so lets add this attributes in the meantime. XCC does not like them so lets only use them with clang. Signed-off-by: Curtis Malainey --- src/audio/dai.c | 3 ++- src/include/sof/compiler_attributes.h | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index c9a0717c3..45e19e0f2 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -692,7 +692,7 @@ static int dai_comp_trigger_internal(struct comp_dev *dev, int cmd) comp_info(dev, "dai_comp_trigger_internal(), XRUN"); dd->xrun = 1; - /* fallthrough */ + COMPILER_FALLTHROUGH; case COMP_TRIGGER_STOP: comp_dbg(dev, "dai_comp_trigger_internal(), STOP"); ret = dma_stop(dd->chan); @@ -702,6 +702,7 @@ static int dai_comp_trigger_internal(struct comp_dev *dev, int cmd) comp_dbg(dev, "dai_comp_trigger_internal(), PAUSE"); ret = dma_pause(dd->chan); dai_trigger(dd->dai, cmd, dev->direction); + break; default: break; } diff --git a/src/include/sof/compiler_attributes.h b/src/include/sof/compiler_attributes.h index 0dbbd0a46..0235cbc9b 100644 --- a/src/include/sof/compiler_attributes.h +++ b/src/include/sof/compiler_attributes.h @@ -17,3 +17,12 @@ #define __section(x) __attribute__((section(x))) +#ifdef __clang__ + +#define COMPILER_FALLTHROUGH __attribute__((fallthrough)) + +#else + +#define COMPILER_FALLTHROUGH /* fallthrough */ + +#endif