use the kernel's way of suppressing fallthrough

See include/linux/compiler_attributes.h:

/*
 * Add the pseudo keyword 'fallthrough' so case statement blocks
 * must end with any of these keywords:
 *   break;
 *   fallthrough;
 *   goto <label>;
 *   return [expression];
 *
 *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
 */
-if __has_attribute(__fallthrough__)
- define fallthrough                    __attribute__((__fallthrough__))
-else
- define fallthrough                    do {} while (0)  /* fallthrough */
-endif
This commit is contained in:
Hin-Tak Leung 2020-04-27 01:04:16 +01:00
parent deed034f31
commit add12477e9
2 changed files with 3 additions and 3 deletions

View file

@ -865,7 +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 */
dev_dbg(dai->dev, "used as slave when AC101 is master\n");
}
/* fall through */
fallthrough;
case SND_SOC_DAIFMT_CBS_CFS: /*AC108 Slave*/
dev_dbg(dai->dev, "AC108 set to work as Slave\n");
/**

View file

@ -752,8 +752,8 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
if ((iface & 0x3) != 0) {
iface |= 0x000c;
break;
};
/* fall through */
}
fallthrough;
default:
dev_err(codec->dev, "unsupported width %d\n",
params_width(params));