hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/isdn/hardware/mISDN/mISDNisar.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * mISDNisar.c ISAR (Siemens PSB 7110) specific functions
34 *
45 * Author Karsten Keil (keil@isdn4linux.de)
56 *
67 * Copyright 2009 by Karsten Keil <keil@isdn4linux.de>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program; if not, write to the Free Software
19
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
- *
218 */
229
2310 /* define this to enable static debug messages, if you kernel supports
....@@ -40,7 +27,6 @@
4027
4128 #define DEBUG_HW_FIRMWARE_FIFO 0x10000
4229
43
-static const u8 faxmodulation_s[] = "3,24,48,72,73,74,96,97,98,121,122,145,146";
4430 static const u8 faxmodulation[] = {3, 24, 48, 72, 73, 74, 96, 97, 98, 121,
4531 122, 145, 146};
4632 #define FAXMODCNT 13
....@@ -235,7 +221,7 @@
235221 goto reterror;
236222 }
237223 if (!poll_mbox(isar, 1000)) {
238
- pr_warning("ISAR poll_mbox dkey failed\n");
224
+ pr_warn("ISAR poll_mbox dkey failed\n");
239225 ret = -ETIME;
240226 goto reterror;
241227 }
....@@ -445,8 +431,8 @@
445431 case ISDN_P_B_MODEM_ASYNC:
446432 maxlen = bchannel_get_rxbuf(&ch->bch, ch->is->clsb);
447433 if (maxlen < 0) {
448
- pr_warning("%s.B%d: No bufferspace for %d bytes\n",
449
- ch->is->name, ch->bch.nr, ch->is->clsb);
434
+ pr_warn("%s.B%d: No bufferspace for %d bytes\n",
435
+ ch->is->name, ch->bch.nr, ch->is->clsb);
450436 ch->is->write_reg(ch->is->hw, ISAR_IIA, 0);
451437 break;
452438 }
....@@ -456,8 +442,8 @@
456442 case ISDN_P_B_HDLC:
457443 maxlen = bchannel_get_rxbuf(&ch->bch, ch->is->clsb);
458444 if (maxlen < 0) {
459
- pr_warning("%s.B%d: No bufferspace for %d bytes\n",
460
- ch->is->name, ch->bch.nr, ch->is->clsb);
445
+ pr_warn("%s.B%d: No bufferspace for %d bytes\n",
446
+ ch->is->name, ch->bch.nr, ch->is->clsb);
461447 ch->is->write_reg(ch->is->hw, ISAR_IIA, 0);
462448 break;
463449 }
....@@ -703,8 +689,7 @@
703689 }
704690 }
705691 }
706
- if (ch->bch.tx_skb)
707
- dev_kfree_skb(ch->bch.tx_skb);
692
+ dev_kfree_skb(ch->bch.tx_skb);
708693 if (get_next_bframe(&ch->bch)) {
709694 isar_fill_fifo(ch);
710695 test_and_clear_bit(FLG_TX_EMPTY, &ch->bch.Flags);
....@@ -758,10 +743,10 @@
758743 }
759744 }
760745
761
-const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4",
746
+static const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4",
762747 "300", "600", "1200", "2400", "4800", "7200",
763748 "9600nt", "9600t", "12000", "14400", "WRONG"};
764
-const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21",
749
+static const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21",
765750 "Bell103", "V23", "Bell202", "V17", "V29", "V27ter"};
766751
767752 static void
....@@ -972,7 +957,7 @@
972957 break;
973958 case PCTRL_CMD_FTM:
974959 p1 = 2;
975
- /* fall through */
960
+ fallthrough;
976961 case PCTRL_CMD_FTH:
977962 send_mbox(ch->is, dps | ISAR_HIS_PUMPCTRL,
978963 PCTRL_CMD_SILON, 1, &p1);
....@@ -1178,7 +1163,7 @@
11781163 send_mbox(ch->is, dps | ISAR_HIS_PUMPCFG,
11791164 PMOD_DTMF, 1, param);
11801165 }
1181
- /* fall through */
1166
+ fallthrough;
11821167 case ISDN_P_B_MODEM_ASYNC:
11831168 ctrl = PMOD_DATAMODEM;
11841169 if (test_bit(FLG_ORIGIN, &ch->bch.Flags)) {
....@@ -1270,7 +1255,7 @@
12701255 case ISDN_P_B_MODEM_ASYNC:
12711256 case ISDN_P_B_T30_FAX:
12721257 cmsb |= IOM_CTRL_RCV;
1273
- /* fall through */
1258
+ fallthrough;
12741259 case ISDN_P_B_L2DTMF:
12751260 if (test_bit(FLG_DTMFSEND, &ch->bch.Flags))
12761261 cmsb |= IOM_CTRL_RCV;
....@@ -1563,7 +1548,7 @@
15631548 ich->is->name, hh->id);
15641549 ret = -EINVAL;
15651550 }
1566
- /* fall through */
1551
+ fallthrough;
15671552 default:
15681553 pr_info("%s: %s unknown prim(%x,%x)\n",
15691554 ich->is->name, __func__, hh->prim, hh->id);