Skip to content

Commit 8b1d858

Browse files
Avenger-285714dtor
authored andcommitted
Input: sparcspkr - avoid unannotated fall-through
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>
1 parent 936a25e commit 8b1d858

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
@@ -74,9 +74,14 @@ static int bbc_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
7474
return -1;
7575

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

8287
if (value > 20 && value < 32767)
@@ -109,9 +114,14 @@ static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned
109114
return -1;
110115

111116
switch (code) {
112-
case SND_BELL: if (value) value = 1000;
113-
case SND_TONE: break;
114-
default: return -1;
117+
case SND_BELL:
118+
if (value)
119+
value = 1000;
120+
break;
121+
case SND_TONE:
122+
break;
123+
default:
124+
return -1;
115125
}
116126

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

0 commit comments

Comments
 (0)