forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/bfa/bfa_fcpim.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
34 * Copyright (c) 2014- QLogic Corporation.
....@@ -5,15 +6,6 @@
56 * www.qlogic.com
67 *
78 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of the GNU General Public License (GPL) Version 2 as
11
- * published by the Free Software Foundation
12
- *
13
- * This program is distributed in the hope that it will be useful, but
14
- * WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * General Public License for more details.
179 */
1810
1911 #include "bfad_drv.h"
....@@ -444,7 +436,7 @@
444436 return BFA_STATUS_OK;
445437 }
446438
447
-void
439
+static void
448440 bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
449441 {
450442 struct bfa_itnim_latency_s *io_lat =
....@@ -461,7 +453,7 @@
461453 io_lat->avg[idx] += val;
462454 }
463455
464
-void
456
+static void
465457 bfa_ioim_profile_start(struct bfa_ioim_s *ioim)
466458 {
467459 ioim->start_time = jiffies;
....@@ -2343,9 +2335,7 @@
23432335 wwn_t rpwwn, struct scsi_lun lun)
23442336 {
23452337 struct bfa_lun_mask_s *lunm_list;
2346
- struct bfa_rport_s *rp = NULL;
23472338 struct bfa_fcs_lport_s *port = NULL;
2348
- struct bfa_fcs_rport_s *rp_fcs;
23492339 int i;
23502340
23512341 /* in min cfg lunm_list could be NULL but no commands should run. */
....@@ -2361,12 +2351,8 @@
23612351 port = bfa_fcs_lookup_port(
23622352 &((struct bfad_s *)bfa->bfad)->bfa_fcs,
23632353 vf_id, *pwwn);
2364
- if (port) {
2354
+ if (port)
23652355 *pwwn = port->port_cfg.pwwn;
2366
- rp_fcs = bfa_fcs_lport_get_rport_by_pwwn(port, rpwwn);
2367
- if (rp_fcs)
2368
- rp = rp_fcs->bfa_rport;
2369
- }
23702356 }
23712357
23722358 lunm_list = bfa_get_lun_mask_list(bfa);
....@@ -2586,6 +2572,7 @@
25862572 case FCP_IODIR_RW:
25872573 bfa_stats(itnim, input_reqs);
25882574 bfa_stats(itnim, output_reqs);
2575
+ fallthrough;
25892576 default:
25902577 bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa));
25912578 }
....@@ -2820,6 +2807,7 @@
28202807
28212808 case BFI_IOIM_STS_TIMEDOUT:
28222809 bfa_stats(ioim->itnim, iocomp_timedout);
2810
+ fallthrough;
28232811 case BFI_IOIM_STS_ABORTED:
28242812 rsp->io_status = BFI_IOIM_STS_ABORTED;
28252813 bfa_stats(ioim->itnim, iocomp_aborted);
....@@ -3215,9 +3203,7 @@
32153203 switch (event) {
32163204 case BFA_TSKIM_SM_DONE:
32173205 bfa_reqq_wcancel(&tskim->reqq_wait);
3218
- /*
3219
- * Fall through !!!
3220
- */
3206
+ fallthrough;
32213207 case BFA_TSKIM_SM_QRESUME:
32223208 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup);
32233209 bfa_tskim_send_abort(tskim);
....@@ -3826,7 +3812,7 @@
38263812 }
38273813
38283814
3829
-/**
3815
+/*
38303816 * To send config req, first try to use throttle value from flash
38313817 * If 0, then use driver parameter
38323818 * We need to use min(flash_val, drv_val) because