Skip to content

Commit f7f7381

Browse files
Maggie ZhangJames Bottomley
authored andcommitted
[SCSI] bfa: clean up one line functions
Cleaned up one line functions. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent df0f193 commit f7f7381

19 files changed

Lines changed: 259 additions & 930 deletions

‎drivers/scsi/bfa/bfa.h‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad,
296296
struct bfa_iocfc_cfg_s *cfg,
297297
struct bfa_meminfo_s *meminfo,
298298
struct bfa_pcidev_s *pcidev);
299-
void bfa_iocfc_detach(struct bfa_s *bfa);
300299
void bfa_iocfc_init(struct bfa_s *bfa);
301300
void bfa_iocfc_start(struct bfa_s *bfa);
302301
void bfa_iocfc_stop(struct bfa_s *bfa);
@@ -385,13 +384,7 @@ void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg,
385384
void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
386385
struct bfa_meminfo_s *meminfo,
387386
struct bfa_pcidev_s *pcidev);
388-
void bfa_init_trc(struct bfa_s *bfa, struct bfa_trc_mod_s *trcmod);
389-
void bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog);
390387
void bfa_detach(struct bfa_s *bfa);
391-
void bfa_init(struct bfa_s *bfa);
392-
void bfa_start(struct bfa_s *bfa);
393-
void bfa_stop(struct bfa_s *bfa);
394-
void bfa_attach_fcs(struct bfa_s *bfa);
395388
void bfa_cb_init(void *bfad, bfa_status_t status);
396389
void bfa_cb_updateq(void *bfad, bfa_status_t status);
397390

@@ -405,24 +398,14 @@ void bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q);
405398

406399
typedef void (*bfa_cb_ioc_t) (void *cbarg, enum bfa_status status);
407400
void bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr);
408-
void bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr);
409401

410402

411403
bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa,
412404
struct bfa_iocfc_intr_attr_s *attr);
413405

414406
void bfa_iocfc_enable(struct bfa_s *bfa);
415407
void bfa_iocfc_disable(struct bfa_s *bfa);
416-
void bfa_timer_tick(struct bfa_s *bfa);
417408
#define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \
418409
bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout)
419410

420-
/*
421-
* BFA debug API functions
422-
*/
423-
bfa_status_t bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen);
424-
bfa_status_t bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen);
425-
bfa_status_t bfa_debug_fwcore(struct bfa_s *bfa, void *buf,
426-
u32 *offset, int *buflen);
427-
428411
#endif /* __BFA_H__ */

‎drivers/scsi/bfa/bfa_core.c‎

Lines changed: 9 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,6 @@ static struct bfa_ioc_cbfn_s bfa_iocfc_cbfn;
6666
/*
6767
* BFA Interrupt handling functions
6868
*/
69-
static void
70-
bfa_msix_errint(struct bfa_s *bfa, u32 intr)
71-
{
72-
bfa_ioc_error_isr(&bfa->ioc);
73-
}
74-
75-
static void
76-
bfa_msix_lpu(struct bfa_s *bfa)
77-
{
78-
bfa_ioc_mbox_isr(&bfa->ioc);
79-
}
80-
8169
static void
8270
bfa_reqq_resume(struct bfa_s *bfa, int qid)
8371
{
@@ -267,7 +255,7 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec)
267255
intr = readl(bfa->iocfc.bfa_regs.intr_status);
268256

269257
if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1))
270-
bfa_msix_lpu(bfa);
258+
bfa_ioc_mbox_isr(&bfa->ioc);
271259

272260
intr &= (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 |
273261
__HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT);
@@ -298,7 +286,7 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec)
298286
}
299287

300288
writel(intr, bfa->iocfc.bfa_regs.intr_status);
301-
bfa_msix_errint(bfa, intr);
289+
bfa_ioc_error_isr(&bfa->ioc);
302290
}
303291
}
304292

@@ -467,8 +455,8 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg,
467455
* First allocate dma memory for IOC.
468456
*/
469457
bfa_ioc_mem_claim(&bfa->ioc, dm_kva, dm_pa);
470-
dm_kva += bfa_ioc_meminfo();
471-
dm_pa += bfa_ioc_meminfo();
458+
dm_kva += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ);
459+
dm_pa += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ);
472460

473461
/*
474462
* Claim DMA-able memory for the request/response queues and for shadow
@@ -531,7 +519,7 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg,
531519
bfa_meminfo_dma_virt(meminfo) = dm_kva;
532520
bfa_meminfo_dma_phys(meminfo) = dm_pa;
533521

534-
dbgsz = bfa_ioc_debug_trcsz(bfa_auto_recover);
522+
dbgsz = (bfa_auto_recover) ? BFA_DBG_FWTRC_LEN : 0;
535523
if (dbgsz > 0) {
536524
bfa_ioc_debug_memclaim(&bfa->ioc, bfa_meminfo_kva(meminfo));
537525
bfa_meminfo_kva(meminfo) += dbgsz;
@@ -723,11 +711,11 @@ bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len,
723711
u32 *dm_len)
724712
{
725713
/* dma memory for IOC */
726-
*dm_len += bfa_ioc_meminfo();
714+
*dm_len += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ);
727715

728716
bfa_iocfc_fw_cfg_sz(cfg, dm_len);
729717
bfa_iocfc_cqs_sz(cfg, dm_len);
730-
*km_len += bfa_ioc_debug_trcsz(bfa_auto_recover);
718+
*km_len += (bfa_auto_recover) ? BFA_DBG_FWTRC_LEN : 0;
731719
}
732720

733721
/*
@@ -759,22 +747,13 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
759747

760748
bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev);
761749
bfa_iocfc_mem_claim(bfa, cfg, meminfo);
762-
bfa_timer_init(&bfa->timer_mod);
750+
INIT_LIST_HEAD(&bfa->timer_mod.timer_q);
763751

764752
INIT_LIST_HEAD(&bfa->comp_q);
765753
for (i = 0; i < BFI_IOC_MAX_CQS; i++)
766754
INIT_LIST_HEAD(&bfa->reqq_waitq[i]);
767755
}
768756

769-
/*
770-
* Query IOC memory requirement information.
771-
*/
772-
void
773-
bfa_iocfc_detach(struct bfa_s *bfa)
774-
{
775-
bfa_ioc_detach(&bfa->ioc);
776-
}
777-
778757
/*
779758
* Query IOC memory requirement information.
780759
*/
@@ -1090,79 +1069,7 @@ bfa_detach(struct bfa_s *bfa)
10901069

10911070
for (i = 0; hal_mods[i]; i++)
10921071
hal_mods[i]->detach(bfa);
1093-
1094-
bfa_iocfc_detach(bfa);
1095-
}
1096-
1097-
1098-
void
1099-
bfa_init_trc(struct bfa_s *bfa, struct bfa_trc_mod_s *trcmod)
1100-
{
1101-
bfa->trcmod = trcmod;
1102-
}
1103-
1104-
void
1105-
bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog)
1106-
{
1107-
bfa->plog = plog;
1108-
}
1109-
1110-
/*
1111-
* Initialize IOC.
1112-
*
1113-
* This function will return immediately, when the IOC initialization is
1114-
* completed, the bfa_cb_init() will be called.
1115-
*
1116-
* @param[in] bfa instance
1117-
*
1118-
* @return void
1119-
*
1120-
* Special Considerations:
1121-
*
1122-
* @note
1123-
* When this function returns, the driver should register the interrupt service
1124-
* routine(s) and enable the device interrupts. If this is not done,
1125-
* bfa_cb_init() will never get called
1126-
*/
1127-
void
1128-
bfa_init(struct bfa_s *bfa)
1129-
{
1130-
bfa_iocfc_init(bfa);
1131-
}
1132-
1133-
/*
1134-
* Use this function initiate the IOC configuration setup. This function
1135-
* will return immediately.
1136-
*
1137-
* @param[in] bfa instance
1138-
*
1139-
* @return None
1140-
*/
1141-
void
1142-
bfa_start(struct bfa_s *bfa)
1143-
{
1144-
bfa_iocfc_start(bfa);
1145-
}
1146-
1147-
/*
1148-
* Use this function quiese the IOC. This function will return immediately,
1149-
* when the IOC is actually stopped, the bfad->comp will be set.
1150-
*
1151-
* @param[in]bfa - pointer to bfa_t.
1152-
*
1153-
* @return None
1154-
*
1155-
* Special Considerations:
1156-
* bfad->comp can be set before or after bfa_stop() returns.
1157-
*
1158-
* @note
1159-
* In case of any failure, we could handle it automatically by doing a
1160-
* reset and then succeed the bfa_stop() call.
1161-
*/
1162-
void
1163-
bfa_stop(struct bfa_s *bfa)
1164-
{
1165-
bfa_iocfc_stop(bfa);
1072+
bfa_ioc_detach(&bfa->ioc);
11661073
}
11671074

11681075
void
@@ -1198,20 +1105,6 @@ bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q)
11981105
}
11991106
}
12001107

1201-
void
1202-
bfa_attach_fcs(struct bfa_s *bfa)
1203-
{
1204-
bfa->fcs = BFA_TRUE;
1205-
}
1206-
1207-
/*
1208-
* Periodic timer heart beat from driver
1209-
*/
1210-
void
1211-
bfa_timer_tick(struct bfa_s *bfa)
1212-
{
1213-
bfa_timer_beat(&bfa->timer_mod);
1214-
}
12151108

12161109
/*
12171110
* Return the list of PCI vendor/device id lists supported by this
@@ -1282,51 +1175,3 @@ bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg)
12821175
cfg->drvcfg.num_rspq_elems = BFA_RSPQ_NELEMS_MIN;
12831176
cfg->drvcfg.min_cfg = BFA_TRUE;
12841177
}
1285-
1286-
void
1287-
bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr)
1288-
{
1289-
bfa_ioc_get_attr(&bfa->ioc, ioc_attr);
1290-
}
1291-
1292-
/*
1293-
* Retrieve firmware trace information on IOC failure.
1294-
*/
1295-
bfa_status_t
1296-
bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen)
1297-
{
1298-
return bfa_ioc_debug_fwsave(&bfa->ioc, trcdata, trclen);
1299-
}
1300-
1301-
/*
1302-
* Fetch firmware trace data.
1303-
*
1304-
* @param[in] bfa BFA instance
1305-
* @param[out] trcdata Firmware trace buffer
1306-
* @param[in,out] trclen Firmware trace buffer len
1307-
*
1308-
* @retval BFA_STATUS_OK Firmware trace is fetched.
1309-
* @retval BFA_STATUS_INPROGRESS Firmware trace fetch is in progress.
1310-
*/
1311-
bfa_status_t
1312-
bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen)
1313-
{
1314-
return bfa_ioc_debug_fwtrc(&bfa->ioc, trcdata, trclen);
1315-
}
1316-
1317-
/*
1318-
* Dump firmware memory.
1319-
*
1320-
* @param[in] bfa BFA instance
1321-
* @param[out] buf buffer for dump
1322-
* @param[in,out] offset smem offset to start read
1323-
* @param[in,out] buflen length of buffer
1324-
*
1325-
* @retval BFA_STATUS_OK Firmware memory is dumped.
1326-
* @retval BFA_STATUS_INPROGRESS Firmware memory dump is in progress.
1327-
*/
1328-
bfa_status_t
1329-
bfa_debug_fwcore(struct bfa_s *bfa, void *buf, u32 *offset, int *buflen)
1330-
{
1331-
return bfa_ioc_debug_fwcore(&bfa->ioc, buf, offset, buflen);
1332-
}

‎drivers/scsi/bfa/bfa_fcpim.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2567,7 +2567,7 @@ bfa_ioim_notify_cleanup(struct bfa_ioim_s *ioim)
25672567
}
25682568
bfa_itnim_iodone(ioim->itnim);
25692569
} else
2570-
bfa_tskim_iodone(ioim->iosp->tskim);
2570+
bfa_wc_down(&ioim->iosp->tskim->wc);
25712571
}
25722572

25732573
static bfa_boolean_t

0 commit comments

Comments
 (0)