hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/input/joystick/sidewinder.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) 1998-2005 Vojtech Pavlik
34 */
....@@ -7,19 +8,6 @@
78 */
89
910 /*
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; if not, write to the Free Software
22
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2311 */
2412
2513 #include <linux/delay.h>
....@@ -235,7 +223,7 @@
235223
236224 static void sw_init_digital(struct gameport *gameport)
237225 {
238
- int seq[] = { 140, 140+725, 140+300, 0 };
226
+ static const int seq[] = { 140, 140+725, 140+300, 0 };
239227 unsigned long flags;
240228 int i, t;
241229
....@@ -668,16 +656,19 @@
668656
669657 switch (i * m) {
670658 case 60:
671
- sw->number++; /* fall through */
659
+ sw->number++;
660
+ fallthrough;
672661 case 45: /* Ambiguous packet length */
673662 if (j <= 40) { /* ID length less or eq 40 -> FSP */
674663 case 43:
675664 sw->type = SW_ID_FSP;
676665 break;
677666 }
678
- sw->number++; /* fall through */
667
+ sw->number++;
668
+ fallthrough;
679669 case 30:
680
- sw->number++; /* fall through */
670
+ sw->number++;
671
+ fallthrough;
681672 case 15:
682673 sw->type = SW_ID_GP;
683674 break;
....@@ -693,9 +684,11 @@
693684 sw->type = SW_ID_PP;
694685 break;
695686 case 66:
696
- sw->bits = 3; /* fall through */
687
+ sw->bits = 3;
688
+ fallthrough;
697689 case 198:
698
- sw->length = 22; /* fall through */
690
+ sw->length = 22;
691
+ fallthrough;
699692 case 64:
700693 sw->type = SW_ID_3DP;
701694 if (j == 160)