Merge pull request #224 from HinTak/suppress-fallthrough-warning

Suppress fallthrough warning
This commit is contained in:
Jack Shao 2020-04-28 09:59:04 +08:00 committed by GitHub
commit 6b4133b5f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View file

@ -865,6 +865,7 @@ static int ac108_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
/* TODO: Both cpu_dai and codec_dai(AC108) be set as slave in DTS */ /* TODO: Both cpu_dai and codec_dai(AC108) be set as slave in DTS */
dev_dbg(dai->dev, "used as slave when AC101 is master\n"); dev_dbg(dai->dev, "used as slave when AC101 is master\n");
} }
fallthrough;
case SND_SOC_DAIFMT_CBS_CFS: /*AC108 Slave*/ case SND_SOC_DAIFMT_CBS_CFS: /*AC108 Slave*/
dev_dbg(dai->dev, "AC108 set to work as Slave\n"); dev_dbg(dai->dev, "AC108 set to work as Slave\n");
/** /**

View file

@ -15,6 +15,14 @@
#define __NO_SND_SOC_CODEC_DRV 0 #define __NO_SND_SOC_CODEC_DRV 0
#endif #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 #if __NO_SND_SOC_CODEC_DRV
#define codec component #define codec component
#define snd_soc_codec snd_soc_component #define snd_soc_codec snd_soc_component

View file

@ -753,6 +753,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
iface |= 0x000c; iface |= 0x000c;
break; break;
} }
fallthrough;
default: default:
dev_err(codec->dev, "unsupported width %d\n", dev_err(codec->dev, "unsupported width %d\n",
params_width(params)); params_width(params));