ALSA: ppc: beep: fix clang -Wimplicit-fallthrough
authorAnders Roxell <anders.roxell@linaro.org>
Tue, 7 Dec 2021 11:00:53 +0000 (12:00 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 7 Dec 2021 14:36:56 +0000 (15:36 +0100)
Clang warns:

sound/ppc/beep.c:103:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
        case SND_TONE: break;
        ^
sound/ppc/beep.c:103:2: note: insert 'break;' to avoid fall-through
        case SND_TONE: break;
        ^
        break;
1 warning generated.

Clang is more pedantic than GCC, which does not warn when failing
through to a case that is just break or return. Clang's version
is more in line with the kernel's own stance in deprecated.rst.
Add athe missing break to silence the warning.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://lore.kernel.org/r/20211207110053.695712-1-anders.roxell@linaro.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/ppc/beep.c

index 0f4bce1c0d4f7a4941f56d32981ada41873e23f4..bf289783eafd225a9503a7189256cadefd2c77ad 100644 (file)
@@ -99,7 +99,7 @@ static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type,
                return -1;
 
        switch (code) {
-       case SND_BELL: if (hz) hz = 1000;
+       case SND_BELL: if (hz) hz = 1000; break;
        case SND_TONE: break;
        default: return -1;
        }