forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/scsi/sym53c8xx_2/sym_hipd.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family
34 * of PCI-SCSI IO processors.
....@@ -22,20 +23,6 @@
2223 * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
2324 *
2425 *-----------------------------------------------------------------------------
25
- *
26
- * This program is free software; you can redistribute it and/or modify
27
- * it under the terms of the GNU General Public License as published by
28
- * the Free Software Foundation; either version 2 of the License, or
29
- * (at your option) any later version.
30
- *
31
- * This program is distributed in the hope that it will be useful,
32
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
33
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
- * GNU General Public License for more details.
35
- *
36
- * You should have received a copy of the GNU General Public License
37
- * along with this program; if not, write to the Free Software
38
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3926 */
4027
4128 #include <linux/slab.h>
....@@ -3072,6 +3059,7 @@
30723059 sym_print_addr(cp->cmd, "%s\n",
30733060 s_status == S_BUSY ? "BUSY" : "QUEUE FULL\n");
30743061 }
3062
+ fallthrough;
30753063 default: /* S_INT, S_INT_COND_MET, S_CONFLICT */
30763064 sym_complete_error (np, cp);
30773065 break;
....@@ -4632,6 +4620,7 @@
46324620 * Negotiation failed.
46334621 * Target does not want answer message.
46344622 */
4623
+ fallthrough;
46354624 case SIR_NEGO_PROTO:
46364625 sym_nego_default(np, tp, cp);
46374626 goto out;
....@@ -5363,8 +5352,10 @@
53635352 {
53645353 struct scsi_device *sdev;
53655354 struct scsi_cmnd *cmd;
5355
+#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING
53665356 struct sym_tcb *tp;
53675357 struct sym_lcb *lp;
5358
+#endif
53685359 int resid;
53695360 int i;
53705361
....@@ -5381,11 +5372,13 @@
53815372 cp->host_status, cp->ssss_status, cp->host_flags);
53825373 }
53835374
5375
+#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING
53845376 /*
53855377 * Get target and lun pointers.
53865378 */
53875379 tp = &np->target[cp->target];
53885380 lp = sym_lp(tp, sdev->lun);
5381
+#endif
53895382
53905383 /*
53915384 * Check for extended errors.
....@@ -5492,8 +5485,10 @@
54925485 */
54935486 void sym_complete_ok (struct sym_hcb *np, struct sym_ccb *cp)
54945487 {
5488
+#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING
54955489 struct sym_tcb *tp;
54965490 struct sym_lcb *lp;
5491
+#endif
54975492 struct scsi_cmnd *cmd;
54985493 int resid;
54995494
....@@ -5509,11 +5504,13 @@
55095504 */
55105505 cmd = cp->cmd;
55115506
5507
+#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING
55125508 /*
55135509 * Get target and lun pointers.
55145510 */
55155511 tp = &np->target[cp->target];
55165512 lp = sym_lp(tp, cp->lun);
5513
+#endif
55175514
55185515 /*
55195516 * If all data have been transferred, given than no
....@@ -5659,7 +5656,7 @@
56595656 /*
56605657 * Allocate the array of lists of CCBs hashed by DSA.
56615658 */
5662
- np->ccbh = kcalloc(CCB_HASH_SIZE, sizeof(struct sym_ccb **), GFP_KERNEL);
5659
+ np->ccbh = kcalloc(CCB_HASH_SIZE, sizeof(*np->ccbh), GFP_KERNEL);
56635660 if (!np->ccbh)
56645661 goto attach_failed;
56655662