hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/scsi/libfc/fc_fcp.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright(c) 2007 Intel Corporation. All rights reserved.
34 * Copyright(c) 2008 Red Hat, Inc. All rights reserved.
45 * Copyright(c) 2008 Mike Christie
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms and conditions of the GNU General Public License,
8
- * version 2, as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope it will be useful, but WITHOUT
11
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- * more details.
14
- *
15
- * You should have received a copy of the GNU General Public License along with
16
- * this program; if not, write to the Free Software Foundation, Inc.,
17
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
186 *
197 * Maintained at www.Open-FCoE.org
208 */
....@@ -301,6 +289,7 @@
301289 /**
302290 * fc_fcp_retry_cmd() - Retry a fcp_pkt
303291 * @fsp: The FCP packet to be retried
292
+ * @status_code: The FCP status code to set
304293 *
305294 * Sets the status code to be FC_ERROR and then calls
306295 * fc_fcp_complete_locked() which in turn calls fc_io_compl().
....@@ -592,7 +581,7 @@
592581 /**
593582 * fc_fcp_send_data() - Send SCSI data to a target
594583 * @fsp: The FCP packet the data is on
595
- * @sp: The sequence the data is to be sent on
584
+ * @seq: The sequence the data is to be sent on
596585 * @offset: The starting offset for this data request
597586 * @seq_blen: The burst length for this data request
598587 *
....@@ -763,7 +752,7 @@
763752 brp = fc_frame_payload_get(fp, sizeof(*brp));
764753 if (brp && brp->br_reason == FC_BA_RJT_LOG_ERR)
765754 break;
766
- /* fall thru */
755
+ fallthrough;
767756 default:
768757 /*
769758 * we will let the command timeout
....@@ -1295,7 +1284,7 @@
12951284
12961285 /**
12971286 * fc_lun_reset_send() - Send LUN reset command
1298
- * @data: The FCP packet that identifies the LUN to be reset
1287
+ * @t: Timer context used to fetch the FSP packet
12991288 */
13001289 static void fc_lun_reset_send(struct timer_list *t)
13011290 {
....@@ -1421,7 +1410,7 @@
14211410
14221411 /**
14231412 * fc_fcp_timeout() - Handler for fcp_pkt timeouts
1424
- * @data: The FCP packet that has timed out
1413
+ * @t: Timer context used to fetch the FSP packet
14251414 *
14261415 * If REC is supported then just issue it and return. The REC exchange will
14271416 * complete or time out and recovery can continue at that point. Otherwise,
....@@ -1547,7 +1536,7 @@
15471536 "device %x invalid REC reject %d/%d\n",
15481537 fsp->rport->port_id, rjt->er_reason,
15491538 rjt->er_explan);
1550
- /* fall through */
1539
+ fallthrough;
15511540 case ELS_RJT_UNSUP:
15521541 FC_FCP_DBG(fsp, "device does not support REC\n");
15531542 rpriv = fsp->rport->dd_data;
....@@ -1679,7 +1668,7 @@
16791668 FC_FCP_DBG(fsp, "REC %p fid %6.6x error unexpected error %d\n",
16801669 fsp, fsp->rport->port_id, error);
16811670 fsp->status_code = FC_CMD_PLOGO;
1682
- /* fall through */
1671
+ fallthrough;
16831672
16841673 case -FC_EX_TIMEOUT:
16851674 /*
....@@ -1703,6 +1692,7 @@
17031692 /**
17041693 * fc_fcp_recovery() - Handler for fcp_pkt recovery
17051694 * @fsp: The FCP pkt that needs to be aborted
1695
+ * @code: The FCP status code to set
17061696 */
17071697 static void fc_fcp_recovery(struct fc_fcp_pkt *fsp, u8 code)
17081698 {
....@@ -1721,6 +1711,7 @@
17211711 * fc_fcp_srr() - Send a SRR request (Sequence Retransmission Request)
17221712 * @fsp: The FCP packet the SRR is to be sent on
17231713 * @r_ctl: The R_CTL field for the SRR request
1714
+ * @offset: The SRR relative offset
17241715 * This is called after receiving status but insufficient data, or
17251716 * when expecting status but the request has timed out.
17261717 */
....@@ -1839,7 +1830,7 @@
18391830 break;
18401831 case -FC_EX_CLOSED: /* e.g., link failure */
18411832 FC_FCP_DBG(fsp, "SRR error, exchange closed\n");
1842
- /* fall through */
1833
+ fallthrough;
18431834 default:
18441835 fc_fcp_retry_cmd(fsp, FC_ERROR);
18451836 break;
....@@ -1863,7 +1854,7 @@
18631854 /**
18641855 * fc_queuecommand() - The queuecommand function of the SCSI template
18651856 * @shost: The Scsi_Host that the command was issued to
1866
- * @cmd: The scsi_cmnd to be executed
1857
+ * @sc_cmd: The scsi_cmnd to be executed
18671858 *
18681859 * This is the i/o strategy routine, called by the SCSI layer.
18691860 */
....@@ -1872,7 +1863,6 @@
18721863 struct fc_lport *lport = shost_priv(shost);
18731864 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
18741865 struct fc_fcp_pkt *fsp;
1875
- struct fc_rport_libfc_priv *rpriv;
18761866 int rval;
18771867 int rc = 0;
18781868 struct fc_stats *stats;
....@@ -1893,8 +1883,6 @@
18931883 sc_cmd->scsi_done(sc_cmd);
18941884 goto out;
18951885 }
1896
-
1897
- rpriv = rport->dd_data;
18981886
18991887 if (!fc_fcp_lport_queue_ready(lport)) {
19001888 if (lport->qfull) {
....@@ -2295,8 +2283,7 @@
22952283
22962284 void fc_destroy_fcp(void)
22972285 {
2298
- if (scsi_pkt_cachep)
2299
- kmem_cache_destroy(scsi_pkt_cachep);
2286
+ kmem_cache_destroy(scsi_pkt_cachep);
23002287 }
23012288
23022289 /**