]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: sparcspkr - avoid unannotated fall-through
authorWangYuli <wangyuli@uniontech.com>
Sat, 19 Apr 2025 01:37:18 +0000 (18:37 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 19 Apr 2025 01:38:46 +0000 (18:38 -0700)
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>
drivers/input/misc/sparcspkr.c

index 8d7303fc13bce3cbc67b9ae4c3078f5b722dd4af..1cfadd73829f8325d32d0fd09613d0c983db8637 100644 (file)
@@ -74,9 +74,14 @@ static int bbc_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
                return -1;
 
        switch (code) {
-               case SND_BELL: if (value) value = 1000;
-               case SND_TONE: break;
-               default: return -1;
+       case SND_BELL:
+               if (value)
+                       value = 1000;
+               break;
+       case SND_TONE:
+               break;
+       default:
+               return -1;
        }
 
        if (value > 20 && value < 32767)
@@ -109,9 +114,14 @@ static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned
                return -1;
 
        switch (code) {
-               case SND_BELL: if (value) value = 1000;
-               case SND_TONE: break;
-               default: return -1;
+       case SND_BELL:
+               if (value)
+                       value = 1000;
+               break;
+       case SND_TONE:
+               break;
+       default:
+               return -1;
        }
 
        if (value > 20 && value < 32767)