Skip to content

Commit 04b6165

Browse files
Avenger-285714popcornmix
authored andcommitted
Input: sparcspkr - avoid unannotated fall-through
commit 8b1d858 upstream. Fix follow warnings with clang-21i (and reformat for clarity): drivers/input/misc/sparcspkr.c:78:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] 78 | case SND_TONE: break; | ^ drivers/input/misc/sparcspkr.c:78:3: note: insert 'break;' to avoid fall-through 78 | case SND_TONE: break; | ^ | break; drivers/input/misc/sparcspkr.c:113:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] 113 | case SND_TONE: break; | ^ drivers/input/misc/sparcspkr.c:113:3: note: insert 'break;' to avoid fall-through 113 | case SND_TONE: break; | ^ | break; 2 warnings generated. Signed-off-by: WangYuli <wangyuli@uniontech.com> Link: https://lore.kernel.org/r/6730E40353C76908+20250415052439.155051-1-wangyuli@uniontech.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7b5214d commit 04b6165

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

drivers/input/misc/sparcspkr.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,14 @@ static int bbc_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
7575
return -1;
7676

7777
switch (code) {
78-
case SND_BELL: if (value) value = 1000;
79-
case SND_TONE: break;
80-
default: return -1;
78+
case SND_BELL:
79+
if (value)
80+
value = 1000;
81+
break;
82+
case SND_TONE:
83+
break;
84+
default:
85+
return -1;
8186
}
8287

8388
if (value > 20 && value < 32767)
@@ -113,9 +118,14 @@ static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned
113118
return -1;
114119

115120
switch (code) {
116-
case SND_BELL: if (value) value = 1000;
117-
case SND_TONE: break;
118-
default: return -1;
121+
case SND_BELL:
122+
if (value)
123+
value = 1000;
124+
break;
125+
case SND_TONE:
126+
break;
127+
default:
128+
return -1;
119129
}
120130

121131
if (value > 20 && value < 32767)

0 commit comments

Comments
 (0)