diff options
Diffstat (limited to 'drivers/scsi')
53 files changed, 324 insertions, 539 deletions
diff --git a/drivers/scsi/bfa/bfa_cb_ioim_macros.h b/drivers/scsi/bfa/bfa_cb_ioim_macros.h index 0050c838c358..961fe439daad 100644 --- a/drivers/scsi/bfa/bfa_cb_ioim_macros.h +++ b/drivers/scsi/bfa/bfa_cb_ioim_macros.h @@ -51,7 +51,7 @@ bfad_int_to_lun(u32 luno) lun.bfa_lun = 0; lun.scsi_lun[0] = bfa_os_htons(luno); - return (lun.bfa_lun); + return lun.bfa_lun; } /** @@ -68,7 +68,7 @@ bfa_cb_ioim_get_cdb(struct bfad_ioim_s *dio) { struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; - return ((u8 *) cmnd->cmnd); + return (u8 *) cmnd->cmnd; } /** @@ -97,7 +97,7 @@ bfa_cb_ioim_get_size(struct bfad_ioim_s *dio) { struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; - return (scsi_bufflen(cmnd)); + return scsi_bufflen(cmnd); } /** @@ -129,7 +129,7 @@ bfa_cb_ioim_get_sgaddr(struct bfad_ioim_s *dio, int sgeid) sge = (struct scatterlist *)scsi_sglist(cmnd) + sgeid; addr = (u64) sg_dma_address(sge); - return (*(union bfi_addr_u *) &addr); + return *((union bfi_addr_u *) &addr); } static inline u32 @@ -197,7 +197,7 @@ bfa_cb_ioim_get_cdblen(struct bfad_ioim_s *dio) { struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; - return (cmnd->cmd_len); + return cmnd->cmd_len; } diff --git a/drivers/scsi/bfa/bfa_cee.c b/drivers/scsi/bfa/bfa_cee.c index 7a959c34e789..2b917792c6bc 100644 --- a/drivers/scsi/bfa/bfa_cee.c +++ b/drivers/scsi/bfa/bfa_cee.c @@ -228,7 +228,7 @@ bfa_cee_reset_stats_isr(struct bfa_cee_s *cee, bfa_status_t status) u32 bfa_cee_meminfo(void) { - return (bfa_cee_attr_meminfo() + bfa_cee_stats_meminfo()); + return bfa_cee_attr_meminfo() + bfa_cee_stats_meminfo(); } /** diff --git a/drivers/scsi/bfa/bfa_csdebug.c b/drivers/scsi/bfa/bfa_csdebug.c index 1b71d349451a..caeb1143a4e6 100644 --- a/drivers/scsi/bfa/bfa_csdebug.c +++ b/drivers/scsi/bfa/bfa_csdebug.c @@ -47,12 +47,12 @@ bfa_q_is_on_q_func(struct list_head *q, struct list_head *qe) tqe = bfa_q_next(q); while (tqe != q) { if (tqe == qe) - return (1); + return 1; tqe = bfa_q_next(tqe); if (tqe == NULL) break; } - return (0); + return 0; } diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c index 401babe3494e..790c945aeae6 100644 --- a/drivers/scsi/bfa/bfa_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcpim.c @@ -131,7 +131,7 @@ bfa_fcpim_path_tov_get(struct bfa_s *bfa) { struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa); - return (fcpim->path_tov / 1000); + return fcpim->path_tov / 1000; } bfa_status_t @@ -169,7 +169,7 @@ bfa_fcpim_qdepth_get(struct bfa_s *bfa) { struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa); - return (fcpim->q_depth); + return fcpim->q_depth; } diff --git a/drivers/scsi/bfa/bfa_fcpim_priv.h b/drivers/scsi/bfa/bfa_fcpim_priv.h index 153206cfb37a..5cf418460f75 100644 --- a/drivers/scsi/bfa/bfa_fcpim_priv.h +++ b/drivers/scsi/bfa/bfa_fcpim_priv.h @@ -35,7 +35,7 @@ #define BFA_FCPIM_PATHTOV_MAX (90 * 1000) /* in millisecs */ #define bfa_fcpim_stats(__fcpim, __stats) \ - (__fcpim)->stats.__stats ++ + ((__fcpim)->stats.__stats++) struct bfa_fcpim_mod_s { struct bfa_s *bfa; @@ -143,7 +143,7 @@ struct bfa_itnim_s { struct bfa_itnim_hal_stats_s stats; }; -#define bfa_itnim_is_online(_itnim) (_itnim)->is_online +#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online) #define BFA_FCPIM_MOD(_hal) (&(_hal)->modules.fcpim_mod) #define BFA_IOIM_FROM_TAG(_fcpim, _iotag) \ (&fcpim->ioim_arr[_iotag]) diff --git a/drivers/scsi/bfa/bfa_fcport.c b/drivers/scsi/bfa/bfa_fcport.c index 992435987deb..aef648b55dfc 100644 --- a/drivers/scsi/bfa/bfa_fcport.c +++ b/drivers/scsi/bfa/bfa_fcport.c @@ -388,32 +388,29 @@ bfa_pport_sm_linkup(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkdown"); - if (BFA_PORT_IS_DISABLED(pport->bfa)) { + if (BFA_PORT_IS_DISABLED(pport->bfa)) bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); - } else { + else bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); - } break; case BFA_PPORT_SM_STOP: bfa_sm_set_state(pport, bfa_pport_sm_stopped); bfa_pport_reset_linkinfo(pport); - if (BFA_PORT_IS_DISABLED(pport->bfa)) { + if (BFA_PORT_IS_DISABLED(pport->bfa)) bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); - } else { + else bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); - } break; case BFA_PPORT_SM_HWFAIL: bfa_sm_set_state(pport, bfa_pport_sm_iocdown); bfa_pport_reset_linkinfo(pport); bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); - if (BFA_PORT_IS_DISABLED(pport->bfa)) { + if (BFA_PORT_IS_DISABLED(pport->bfa)) bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); - } else { + else bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); - } break; default: @@ -999,10 +996,10 @@ bfa_pport_enable(struct bfa_s *bfa) struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); if (pport->diag_busy) - return (BFA_STATUS_DIAG_BUSY); + return BFA_STATUS_DIAG_BUSY; else if (bfa_sm_cmp_state (BFA_PORT_MOD(bfa), bfa_pport_sm_disabling_qwait)) - return (BFA_STATUS_DEVBUSY); + return BFA_STATUS_DEVBUSY; bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_ENABLE); return BFA_STATUS_OK; @@ -1032,7 +1029,7 @@ bfa_pport_cfg_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) pport->cfg.speed = speed; - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } /** @@ -1068,7 +1065,7 @@ bfa_pport_cfg_topology(struct bfa_s *bfa, enum bfa_pport_topology topology) } pport->cfg.topology = topology; - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } /** @@ -1094,7 +1091,7 @@ bfa_pport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa) pport->cfg.cfg_hardalpa = BFA_TRUE; pport->cfg.hardalpa = alpa; - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } bfa_status_t @@ -1106,7 +1103,7 @@ bfa_pport_clr_hardalpa(struct bfa_s *bfa) bfa_trc(bfa, pport->cfg.hardalpa); pport->cfg.cfg_hardalpa = BFA_FALSE; - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } bfa_boolean_t @@ -1138,16 +1135,16 @@ bfa_pport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxfrsize) * with in range */ if ((maxfrsize > FC_MAX_PDUSZ) || (maxfrsize < FC_MIN_PDUSZ)) - return (BFA_STATUS_INVLD_DFSZ); + return BFA_STATUS_INVLD_DFSZ; /* * power of 2, if not the max frame size of 2112 */ if ((maxfrsize != FC_MAX_PDUSZ) && (maxfrsize & (maxfrsize - 1))) - return (BFA_STATUS_INVLD_DFSZ); + return BFA_STATUS_INVLD_DFSZ; pport->cfg.maxfrsize = maxfrsize; - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } u16 @@ -1415,7 +1412,7 @@ bfa_pport_get_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, if (port->stats_busy) { bfa_trc(bfa, port->stats_busy); - return (BFA_STATUS_DEVBUSY); + return BFA_STATUS_DEVBUSY; } port->stats_busy = BFA_TRUE; @@ -1427,7 +1424,7 @@ bfa_pport_get_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, bfa_timer_start(bfa, &port->timer, bfa_port_stats_timeout, port, BFA_PORT_STATS_TOV); - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } bfa_status_t @@ -1437,7 +1434,7 @@ bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) if (port->stats_busy) { bfa_trc(bfa, port->stats_busy); - return (BFA_STATUS_DEVBUSY); + return BFA_STATUS_DEVBUSY; } port->stats_busy = BFA_TRUE; @@ -1448,7 +1445,7 @@ bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, BFA_PORT_STATS_TOV); - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } bfa_status_t @@ -1515,7 +1512,7 @@ bfa_pport_get_qos_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, /* * QoS stats is embedded in port stats */ - return (bfa_pport_get_stats(bfa, stats, cbfn, cbarg)); + return bfa_pport_get_stats(bfa, stats, cbfn, cbarg); } bfa_status_t @@ -1525,7 +1522,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) if (port->stats_busy) { bfa_trc(bfa, port->stats_busy); - return (BFA_STATUS_DEVBUSY); + return BFA_STATUS_DEVBUSY; } port->stats_busy = BFA_TRUE; @@ -1536,7 +1533,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, BFA_PORT_STATS_TOV); - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } /** @@ -1545,7 +1542,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) bfa_status_t bfa_pport_trunk_disable(struct bfa_s *bfa) { - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } bfa_boolean_t @@ -1562,8 +1559,8 @@ bfa_pport_is_disabled(struct bfa_s *bfa) { struct bfa_pport_s *port = BFA_PORT_MOD(bfa); - return (bfa_sm_to_state(hal_pport_sm_table, port->sm) == - BFA_PPORT_ST_DISABLED); + return bfa_sm_to_state(hal_pport_sm_table, port->sm) == + BFA_PPORT_ST_DISABLED; } @@ -1572,7 +1569,7 @@ bfa_pport_is_ratelim(struct bfa_s *bfa) { struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); -return (pport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE); + return pport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; } @@ -1620,7 +1617,7 @@ bfa_pport_cfg_ratelim_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) pport->cfg.trl_def_speed = speed; - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } /** @@ -1632,7 +1629,7 @@ bfa_pport_get_ratelim_speed(struct bfa_s *bfa) struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); bfa_trc(bfa, pport->cfg.trl_def_speed); - return (pport->cfg.trl_def_speed); + return pport->cfg.trl_def_speed; } diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 8975ed041dc0..c7ab257f10a7 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c @@ -568,11 +568,10 @@ bfa_fcs_port_offline_actions(struct bfa_fcs_port_s *port) __port_action[port->fabric->fab_type].offline(port); - if (bfa_fcs_fabric_is_online(port->fabric) == BFA_TRUE) { + if (bfa_fcs_fabric_is_online(port->fabric) == BFA_TRUE) bfa_fcs_port_aen_post(port, BFA_LPORT_AEN_DISCONNECT); - } else { + else bfa_fcs_port_aen_post(port, BFA_LPORT_AEN_OFFLINE); - } bfa_fcb_port_offline(port->fcs->bfad, port->port_cfg.roles, port->fabric->vf_drv, (port->vport == NULL) ? NULL : port->vport->vport_drv); @@ -777,7 +776,7 @@ bfa_fcs_port_get_rport_by_pwwn(struct bfa_fcs_port_s *port, wwn_t pwwn) } bfa_trc(port->fcs, pwwn); - return (NULL); + return NULL; } /** @@ -796,7 +795,7 @@ bfa_fcs_port_get_rport_by_nwwn(struct bfa_fcs_port_s *port, wwn_t nwwn) } bfa_trc(port->fcs, nwwn); - return (NULL); + return NULL; } /** @@ -870,7 +869,7 @@ bfa_fcs_port_lip(struct bfa_fcs_port_s *port) bfa_boolean_t bfa_fcs_port_is_online(struct bfa_fcs_port_s *port) { - return (bfa_sm_cmp_state(port, bfa_fcs_port_sm_online)); + return bfa_sm_cmp_state(port, bfa_fcs_port_sm_online); } /** diff --git a/drivers/scsi/bfa/bfa_fcxp.c b/drivers/scsi/bfa/bfa_fcxp.c index 4754a0e9006a..cf0ad6782686 100644 --- a/drivers/scsi/bfa/bfa_fcxp.c +++ b/drivers/scsi/bfa/bfa_fcxp.c @@ -199,7 +199,7 @@ bfa_fcxp_get(struct bfa_fcxp_mod_s *fm) if (fcxp) list_add_tail(&fcxp->qe, &fm->fcxp_active_q); - return (fcxp); + return fcxp; } static void @@ -503,7 +503,7 @@ bfa_fcxp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles, fcxp = bfa_fcxp_get(BFA_FCXP_MOD(bfa)); if (fcxp == NULL) - return (NULL); + return NULL; bfa_trc(bfa, fcxp->fcxp_tag); @@ -568,7 +568,7 @@ bfa_fcxp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles, } } - return (fcxp); + return fcxp; } /** @@ -709,7 +709,7 @@ bfa_status_t bfa_fcxp_abort(struct bfa_fcxp_s *fcxp) { bfa_assert(0); - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } void diff --git a/drivers/scsi/bfa/bfa_intr.c b/drivers/scsi/bfa/bfa_intr.c index 0ca125712a04..b36540e4ed76 100644 --- a/drivers/scsi/bfa/bfa_intr.c +++ b/drivers/scsi/bfa/bfa_intr.c @@ -59,7 +59,7 @@ bfa_intx(struct bfa_s *bfa) qintr = intr & __HFN_INT_RME_MASK; bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, qintr); - for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue ++) { + for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) { if (intr & (__HFN_INT_RME_Q0 << queue)) bfa_msix_rspq(bfa, queue & (BFI_IOC_MAX_CQS - 1)); } diff --git a/drivers/scsi/bfa/bfa_intr_priv.h b/drivers/scsi/bfa/bfa_intr_priv.h index 8ce6e6b105c8..5fc301cf4d1b 100644 --- a/drivers/scsi/bfa/bfa_intr_priv.h +++ b/drivers/scsi/bfa/bfa_intr_priv.h @@ -26,9 +26,9 @@ void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m); void bfa_isr_bind(enum bfi_mclass mc, bfa_isr_func_t isr_func); -#define bfa_reqq_pi(__bfa, __reqq) (__bfa)->iocfc.req_cq_pi[__reqq] +#define bfa_reqq_pi(__bfa, __reqq) ((__bfa)->iocfc.req_cq_pi[__reqq]) #define bfa_reqq_ci(__bfa, __reqq) \ - *(u32 *)((__bfa)->iocfc.req_cq_shadow_ci[__reqq].kva) + (*(u32 *)((__bfa)->iocfc.req_cq_shadow_ci[__reqq].kva)) #define bfa_reqq_full(__bfa, __reqq) \ (((bfa_reqq_pi(__bfa, __reqq) + 1) & \ @@ -50,14 +50,16 @@ void bfa_isr_bind(enum bfi_mclass mc, bfa_isr_func_t isr_func); } while (0) #define bfa_rspq_pi(__bfa, __rspq) \ - *(u32 *)((__bfa)->iocfc.rsp_cq_shadow_pi[__rspq].kva) + (*(u32 *)((__bfa)->iocfc.rsp_cq_shadow_pi[__rspq].kva)) -#define bfa_rspq_ci(__bfa, __rspq) (__bfa)->iocfc.rsp_cq_ci[__rspq] +#define bfa_rspq_ci(__bfa, __rspq) ((__bfa)->iocfc.rsp_cq_ci[__rspq]) #define bfa_rspq_elem(__bfa, __rspq, __ci) \ - &((struct bfi_msg_s *)((__bfa)->iocfc.rsp_cq_ba[__rspq].kva))[__ci] + (&((struct bfi_msg_s *)((__bfa)->iocfc.rsp_cq_ba[__rspq].kva))[__ci]) -#define CQ_INCR(__index, __size) \ - (__index)++; (__index) &= ((__size) - 1) +#define CQ_INCR(__index, __size) do { \ + (__index)++; \ + (__index) &= ((__size) - 1); \ +} while (0) /** * Queue element to wait for room in request queue. FIFO order is @@ -94,7 +96,7 @@ bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg), wqe->cbarg = cbarg; } -#define bfa_reqq(__bfa, __reqq) &(__bfa)->reqq_waitq[__reqq] +#define bfa_reqq(__bfa, __reqq) (&(__bfa)->reqq_waitq[__reqq]) /** * static inline void diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 149348934ce3..397d7e9eade5 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c @@ -51,7 +51,7 @@ BFA_TRC_FILE(HAL, IOC); (sizeof(struct bfa_trc_mod_s) - \ BFA_TRC_MAX * sizeof(struct bfa_trc_s))) #define BFA_DBG_FWTRC_OFF(_fn) (BFI_IOC_TRC_OFF + BFA_DBG_FWTRC_LEN * (_fn)) -#define bfa_ioc_stats(_ioc, _stats) (_ioc)->stats._stats ++ +#define bfa_ioc_stats(_ioc, _stats) ((_ioc)->stats._stats++) #define BFA_FLASH_CHUNK_NO(off) (off / BFI_FLASH_CHUNK_SZ_WORDS) #define BFA_FLASH_OFFSET_IN_CHUNK(off) (off % BFI_FLASH_CHUNK_SZ_WORDS) @@ -1953,8 +1953,8 @@ bfa_ioc_error_isr(struct bfa_ioc_s *ioc) bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc) { - return (bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabling) - || bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabled)); + return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabling) + || bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabled); } /** @@ -1963,9 +1963,9 @@ bfa_ioc_is_disabled(struct bfa_ioc_s *ioc) bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc) { - return (bfa_fsm_cmp_state(ioc, bfa_ioc_sm_reset) + return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_reset) || bfa_fsm_cmp_state(ioc, bfa_ioc_sm_fwcheck) - || bfa_fsm_cmp_state(ioc, bfa_ioc_sm_mismatch)); + || bfa_fsm_cmp_state(ioc, bfa_ioc_sm_mismatch); } #define bfa_ioc_state_disabled(__sm) \ diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 58efd4b13143..7c30f05ab137 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h @@ -179,16 +179,16 @@ struct bfa_ioc_s { struct bfa_ioc_mbox_mod_s mbox_mod; }; -#define bfa_ioc_pcifn(__ioc) (__ioc)->pcidev.pci_func -#define bfa_ioc_devid(__ioc) (__ioc)->pcidev.device_id -#define bfa_ioc_bar0(__ioc) (__ioc)->pcidev.pci_bar_kva +#define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) +#define bfa_ioc_devid(__ioc) ((__ioc)->pcidev.device_id) +#define bfa_ioc_bar0(__ioc) ((__ioc)->pcidev.pci_bar_kva) #define bfa_ioc_portid(__ioc) ((__ioc)->port_id) #define bfa_ioc_fetch_stats(__ioc, __stats) \ - ((__stats)->drv_stats) = (__ioc)->stats + (((__stats)->drv_stats) = (__ioc)->stats) #define bfa_ioc_clr_stats(__ioc) \ bfa_os_memset(&(__ioc)->stats, 0, sizeof((__ioc)->stats)) -#define bfa_ioc_maxfrsize(__ioc) (__ioc)->attr->maxfrsize -#define bfa_ioc_rx_bbcredit(__ioc) (__ioc)->attr->rx_bbcredit +#define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize) +#define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) #define bfa_ioc_speed_sup(__ioc) \ BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop) diff --git a/drivers/scsi/bfa/bfa_iocfc.c b/drivers/scsi/bfa/bfa_iocfc.c index 12350b022d63..d7ab792a9e54 100644 --- a/drivers/scsi/bfa/bfa_iocfc.c +++ b/drivers/scsi/bfa/bfa_iocfc.c @@ -794,7 +794,7 @@ bfa_iocfc_get_stats(struct bfa_s *bfa, struct bfa_iocfc_stats_s *stats, if (iocfc->stats_busy) { bfa_trc(bfa, iocfc->stats_busy); - return (BFA_STATUS_DEVBUSY); + return BFA_STATUS_DEVBUSY; } iocfc->stats_busy = BFA_TRUE; @@ -804,7 +804,7 @@ bfa_iocfc_get_stats(struct bfa_s *bfa, struct bfa_iocfc_stats_s *stats, bfa_iocfc_stats_query(bfa); - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } bfa_status_t @@ -814,7 +814,7 @@ bfa_iocfc_clear_stats(struct bfa_s *bfa, bfa_cb_ioc_t cbfn, void *cbarg) if (iocfc->stats_busy) { bfa_trc(bfa, iocfc->stats_busy); - return (BFA_STATUS_DEVBUSY); + return BFA_STATUS_DEVBUSY; } iocfc->stats_busy = BFA_TRUE; @@ -822,7 +822,7 @@ bfa_iocfc_clear_stats(struct bfa_s *bfa, bfa_cb_ioc_t cbfn, void *cbarg) iocfc->stats_cbarg = cbarg; bfa_iocfc_stats_clear(bfa); - return (BFA_STATUS_OK); + return BFA_STATUS_OK; } /** diff --git a/drivers/scsi/bfa/bfa_iocfc.h b/drivers/scsi/bfa/bfa_iocfc.h index 7ad177ed4cfc..ce9a830a4207 100644 --- a/drivers/scsi/bfa/bfa_iocfc.h +++ b/drivers/scsi/bfa/bfa_iocfc.h @@ -107,13 +107,13 @@ struct bfa_iocfc_s { #define bfa_lpuid(__bfa) bfa_ioc_portid(&(__bfa)->ioc) #define bfa_msix_init(__bfa, __nvecs) \ - (__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs) + ((__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs)) #define bfa_msix_install(__bfa) \ - (__bfa)->iocfc.hwif.hw_msix_install(__bfa) + ((__bfa)->iocfc.hwif.hw_msix_install(__bfa)) #define bfa_msix_uninstall(__bfa) \ - (__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa) + ((__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa)) #define bfa_isr_mode_set(__bfa, __msix) \ - (__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix) + ((__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix)) #define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \ (__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) diff --git a/drivers/scsi/bfa/bfa_ioim.c b/drivers/scsi/bfa/bfa_ioim.c index 7ae2552e1e14..f81d359b7089 100644 --- a/drivers/scsi/bfa/bfa_ioim.c +++ b/drivers/scsi/bfa/bfa_ioim.c @@ -105,13 +105,13 @@ bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); list_del(&ioim->qe); list_add_tail(&ioim->qe, - &ioim->fcpim->ioim_comp_q); + &ioim->fcpim->ioim_comp_q); bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_pathtov, ioim); } else { list_del(&ioim->qe); list_add_tail(&ioim->qe, - &ioim->itnim->pending_q); + &ioim->itnim->pending_q); } break; } diff --git a/drivers/scsi/bfa/bfa_itnim.c b/drivers/scsi/bfa/bfa_itnim.c index 4d5c61a4f85c..eabf7d38bd09 100644 --- a/drivers/scsi/bfa/bfa_itnim.c +++ b/drivers/scsi/bfa/bfa_itnim.c @@ -1029,7 +1029,7 @@ bfa_itnim_create(struct bfa_s *bfa, struct bfa_rport_s *rport, void *ditn) bfa_stats(itnim, creates); bfa_sm_send_event(itnim, BFA_ITNIM_SM_CREATE); - return (itnim); + return itnim; } void @@ -1061,7 +1061,7 @@ bfa_itnim_offline(struct bfa_itnim_s *itnim) bfa_boolean_t bfa_itnim_hold_io(struct bfa_itnim_s *itnim) { - return ( + return itnim->fcpim->path_tov && itnim->iotov_active && (bfa_sm_cmp_state(itnim, bfa_itnim_sm_fwcreate) || bfa_sm_cmp_state(itnim, bfa_itnim_sm_sler) || @@ -1069,7 +1069,7 @@ bfa_itnim_hold_io(struct bfa_itnim_s *itnim) bfa_sm_cmp_state(itnim, bfa_itnim_sm_fwdelete) || bfa_sm_cmp_state(itnim, bfa_itnim_sm_offline) || bfa_sm_cmp_state(itnim, bfa_itnim_sm_iocdisable)) -); + ; } void diff --git a/drivers/scsi/bfa/bfa_log.c b/drivers/scsi/bfa/bfa_log.c index c2735e55cf03..e7514016c9c6 100644 --- a/drivers/scsi/bfa/bfa_log.c +++ b/drivers/scsi/bfa/bfa_log.c @@ -231,9 +231,9 @@ bfa_log_get_level(struct bfa_log_mod_s *log_mod, int mod_id) return BFA_LOG_INVALID; if (log_mod) - return (log_mod->log_level[mod_id]); + return log_mod->log_level[mod_id]; else - return (bfa_log_info[mod_id].level); + return bfa_log_info[mod_id].level; } enum bfa_log_severity diff --git a/drivers/scsi/bfa/bfa_port_priv.h b/drivers/scsi/bfa/bfa_port_priv.h index 4b97e2759908..51f698a06b6d 100644 --- a/drivers/scsi/bfa/bfa_port_priv.h +++ b/drivers/scsi/bfa/bfa_port_priv.h @@ -59,8 +59,8 @@ struct bfa_pport_s { u8 *stats_kva; u64 stats_pa; union bfa_pport_stats_u *stats; /* pport stats */ - u32 mypid : 24; - u32 rsvd_b : 8; + u32 mypid:24; + u32 rsvd_b:8; struct bfa_timer_s timer; /* timer */ union bfa_pport_stats_u *stats_ret; /* driver stats location */ diff --git a/drivers/scsi/bfa/bfa_rport.c b/drivers/scsi/bfa/bfa_rport.c index 16da77a8db28..3e1990a74258 100644 --- a/drivers/scsi/bfa/bfa_rport.c +++ b/drivers/scsi/bfa/bfa_rport.c @@ -677,7 +677,7 @@ bfa_rport_alloc(struct bfa_rport_mod_s *mod) if (rport) list_add_tail(&rport->qe, &mod->rp_active_q); - return (rport); + return rport; } static void @@ -834,7 +834,7 @@ bfa_rport_create(struct bfa_s *bfa, void *rport_drv) rp = bfa_rport_alloc(BFA_RPORT_MOD(bfa)); if (rp == NULL) - return (NULL); + return NULL; rp->bfa = bfa; rp->rport_drv = rport_drv; @@ -843,7 +843,7 @@ bfa_rport_create(struct bfa_s *bfa, void *rport_drv) bfa_assert(bfa_sm_cmp_state(rp, bfa_rport_sm_uninit)); bfa_sm_send_event(rp, BFA_RPORT_SM_CREATE); - return (rp); + return rp; } void diff --git a/drivers/scsi/bfa/bfa_tskim.c b/drivers/scsi/bfa/bfa_tskim.c index 010d40d1e5d3..ff7a4dc0bf3c 100644 --- a/drivers/scsi/bfa/bfa_tskim.c +++ b/drivers/scsi/bfa/bfa_tskim.c @@ -23,13 +23,14 @@ BFA_TRC_FILE(HAL, TSKIM); /** * task management completion handling */ -#define bfa_tskim_qcomp(__tskim, __cbfn) do { \ - bfa_cb_queue((__tskim)->bfa, &(__tskim)->hcb_qe, __cbfn, (__tskim)); \ +#define bfa_tskim_qcomp(__tskim, __cbfn) do { \ + bfa_cb_queue((__tskim)->bfa, &(__tskim)->hcb_qe, \ + __cbfn, (__tskim)); \ bfa_tskim_notify_comp(__tskim); \ } while (0) -#define bfa_tskim_notify_comp(__tskim) do { \ - if ((__tskim)->notify) \ +#define bfa_tskim_notify_comp(__tskim) do { \ + if ((__tskim)->notify) \ bfa_itnim_tskdone((__tskim)->itnim); \ } while (0) diff --git a/drivers/scsi/bfa/bfa_uf.c b/drivers/scsi/bfa/bfa_uf.c index ff5f9deb1b22..4b3c2417d180 100644 --- a/drivers/scsi/bfa/bfa_uf.c +++ b/drivers/scsi/bfa/bfa_uf.c @@ -185,7 +185,7 @@ bfa_uf_get(struct bfa_uf_mod_s *uf_mod) struct bfa_uf_s *uf; bfa_q_deq(&uf_mod->uf_free_q, &uf); - return (uf); + return uf; } static void diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 6f2be5abf561..b52b773d49d9 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c @@ -188,8 +188,8 @@ static struct bfad_port_s * bfad_get_drv_port(struct bfad_s *bfad, struct bfad_vf_s *vf_drv, struct bfad_vport_s *vp_drv) { - return ((vp_drv) ? (&(vp_drv)->drv_port) - : ((vf_drv) ? (&(vf_drv)->base_port) : (&(bfad)->pport))); + return (vp_drv) ? (&(vp_drv)->drv_port) + : ((vf_drv) ? (&(vf_drv)->base_port) : (&(bfad)->pport)); } struct bfad_port_s * @@ -716,7 +716,7 @@ bfad_drv_init(struct bfad_s *bfad) if ((bfad->bfad_flags & BFAD_MSIX_ON) && bfad_install_msix_handler(bfad)) { printk(KERN_WARNING "%s: install_msix failed, bfad%d\n", - __FUNCTION__, bfad->inst_no); + __func__, bfad->inst_no); } bfad_init_timer(bfad); diff --git a/drivers/scsi/bfa/bfad_fwimg.c b/drivers/scsi/bfa/bfad_fwimg.c index b2f6949bc8d3..2c2082d6ce45 100644 --- a/drivers/scsi/bfa/bfad_fwimg.c +++ b/drivers/scsi/bfa/bfad_fwimg.c @@ -63,10 +63,10 @@ bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image, memcpy(*bfi_image, fw->data, fw->size); *bfi_image_size = fw->size/sizeof(u32); - return(*bfi_image); + return *bfi_image; error: - return(NULL); + return NULL; } u32 * @@ -76,12 +76,12 @@ bfad_get_firmware_buf(struct pci_dev *pdev) if (bfi_image_ct_size == 0) bfad_read_firmware(pdev, &bfi_image_ct, &bfi_image_ct_size, BFAD_FW_FILE_CT); - return(bfi_image_ct); + return bfi_image_ct; } else { if (bfi_image_cb_size == 0) bfad_read_firmware(pdev, &bfi_image_cb, &bfi_image_cb_size, BFAD_FW_FILE_CB); - return(bfi_image_cb); + return bfi_image_cb; } } diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 158c99243c08..ae3a0689a66f 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -1050,7 +1050,7 @@ bfad_im_itnim_work_handler(struct work_struct *work) } else { printk(KERN_WARNING "%s: itnim %llx is already in online state\n", - __FUNCTION__, + __func__, bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim)); } diff --git a/drivers/scsi/bfa/bfad_im_compat.h b/drivers/scsi/bfa/bfad_im_compat.h index 1d3e74ec338c..b36be15044a4 100644 --- a/drivers/scsi/bfa/bfad_im_compat.h +++ b/drivers/scsi/bfa/bfad_im_compat.h @@ -31,7 +31,7 @@ u32 *bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image, static inline u32 * bfad_load_fwimg(struct pci_dev *pdev) { - return(bfad_get_firmware_buf(pdev)); + return bfad_get_firmware_buf(pdev); } static inline void diff --git a/drivers/scsi/bfa/bfad_intr.c b/drivers/scsi/bfa/bfad_intr.c index f104e029cac9..7de8832f6fee 100644 --- a/drivers/scsi/bfa/bfad_intr.c +++ b/drivers/scsi/bfa/bfad_intr.c @@ -23,13 +23,12 @@ BFA_TRC_FILE(LDRV, INTR); /** * bfa_isr BFA driver interrupt functions */ -irqreturn_t bfad_intx(int irq, void *dev_id); static int msix_disable; module_param(msix_disable, int, S_IRUGO | S_IWUSR); /** * Line based interrupt handler. */ -irqreturn_t +static irqreturn_t bfad_intx(int irq, void *dev_id) { struct bfad_s *bfad = dev_id; diff --git a/drivers/scsi/bfa/fabric.c b/drivers/scsi/bfa/fabric.c index a8b14c47b009..a4b5dd449573 100644 --- a/drivers/scsi/bfa/fabric.c +++ b/drivers/scsi/bfa/fabric.c @@ -36,12 +36,12 @@ BFA_TRC_FILE(FCS, FABRIC); #define BFA_FCS_FABRIC_RETRY_DELAY (2000) /* Milliseconds */ #define BFA_FCS_FABRIC_CLEANUP_DELAY (10000) /* Milliseconds */ -#define bfa_fcs_fabric_set_opertype(__fabric) do { \ - if (bfa_pport_get_topology((__fabric)->fcs->bfa) \ - == BFA_PPORT_TOPOLOGY_P2P) \ - (__fabric)->oper_type = BFA_PPORT_TYPE_NPORT; \ - else \ - (__fabric)->oper_type = BFA_PPORT_TYPE_NLPORT; \ +#define bfa_fcs_fabric_set_opertype(__fabric) do { \ + if (bfa_pport_get_topology((__fabric)->fcs->bfa) \ + == BFA_PPORT_TOPOLOGY_P2P) \ + (__fabric)->oper_type = BFA_PPORT_TYPE_NPORT; \ + else \ + (__fabric)->oper_type = BFA_PPORT_TYPE_NLPORT; \ } while (0) /* @@ -887,7 +887,7 @@ bfa_fcs_fabric_modsusp(struct bfa_fcs_s *fcs) bfa_boolean_t bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric) { - return (bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_loopback)); + return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_loopback); } enum bfa_pport_type @@ -974,7 +974,7 @@ bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric) int bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric) { - return (bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_online)); + return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_online); } @@ -1015,7 +1015,7 @@ bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn) u16 bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric) { - return (fabric->num_vports); + return fabric->num_vports; } /** diff --git a/drivers/scsi/bfa/fcbuild.c b/drivers/scsi/bfa/fcbuild.c index d174706b9caa..fee5456451cb 100644 --- a/drivers/scsi/bfa/fcbuild.c +++ b/drivers/scsi/bfa/fcbuild.c @@ -188,14 +188,14 @@ fc_els_rsp_parse(struct fchs_s *fchs, int len) switch (els_cmd->els_code) { case FC_ELS_LS_RJT: if (ls_rjt->reason_code == FC_LS_RJT_RSN_LOGICAL_BUSY) - return (FC_PARSE_BUSY); + return FC_PARSE_BUSY; else - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; case FC_ELS_ACC: - return (FC_PARSE_OK); + return FC_PARSE_OK; } - return (FC_PARSE_OK); + return FC_PARSE_OK; } static void @@ -228,7 +228,7 @@ fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, bfa_os_memcpy(&plogi->port_name, &port_name, sizeof(wwn_t)); bfa_os_memcpy(&plogi->node_name, &node_name, sizeof(wwn_t)); - return (sizeof(struct fc_logi_s)); + return sizeof(struct fc_logi_s); } u16 @@ -267,7 +267,7 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, flogi->csp.npiv_supp = 1; /* @todo. field name is not correct */ vvl_info[0] = bfa_os_htonl(FLOGI_VVL_BRCD); - return (sizeof(struct fc_logi_s)); + return sizeof(struct fc_logi_s); } u16 @@ -287,7 +287,7 @@ fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, flogi->csp.bbcred = bfa_os_htons(local_bb_credits); - return (sizeof(struct fc_logi_s)); + return sizeof(struct fc_logi_s); } u16 @@ -306,7 +306,7 @@ fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, flogi->port_name = port_name; flogi->node_name = node_name; - return (sizeof(struct fc_logi_s)); + return sizeof(struct fc_logi_s); } u16 @@ -338,26 +338,26 @@ fc_plogi_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name) case FC_ELS_LS_RJT: ls_rjt = (struct fc_ls_rjt_s *) (fchs + 1); if (ls_rjt->reason_code == FC_LS_RJT_RSN_LOGICAL_BUSY) - return (FC_PARSE_BUSY); + return FC_PARSE_BUSY; else - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; case FC_ELS_ACC: plogi = (struct fc_logi_s *) (fchs + 1); if (len < sizeof(struct fc_logi_s)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (!wwn_is_equal(plogi->port_name, port_name)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (!plogi->class3.class_valid) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (bfa_os_ntohs(plogi->class3.rxsz) < (FC_MIN_PDUSZ)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; - return (FC_PARSE_OK); + return FC_PARSE_OK; default: - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; } } @@ -372,7 +372,7 @@ fc_plogi_parse(struct fchs_s *fchs) if ((bfa_os_ntohs(plogi->class3.rxsz) < FC_MIN_PDUSZ) || (bfa_os_ntohs(plogi->class3.rxsz) > FC_MAX_PDUSZ) || (plogi->class3.rxsz == 0)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; return FC_PARSE_OK; } @@ -393,7 +393,7 @@ fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, prli->parampage.servparams.task_retry_id = 0; prli->parampage.servparams.confirm = 1; - return (sizeof(struct fc_prli_s)); + return sizeof(struct fc_prli_s); } u16 @@ -414,41 +414,41 @@ fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, prli->parampage.rspcode = FC_PRLI_ACC_XQTD; - return (sizeof(struct fc_prli_s)); + return sizeof(struct fc_prli_s); } enum fc_parse_status fc_prli_rsp_parse(struct fc_prli_s *prli, int len) { if (len < sizeof(struct fc_prli_s)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (prli->command != FC_ELS_ACC) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if ((prli->parampage.rspcode != FC_PRLI_ACC_XQTD) && (prli->parampage.rspcode != FC_PRLI_ACC_PREDEF_IMG)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (prli->parampage.servparams.target != 1) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; - return (FC_PARSE_OK); + return FC_PARSE_OK; } enum fc_parse_status fc_prli_parse(struct fc_prli_s *prli) { if (prli->parampage.type != FC_TYPE_FCP) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (!prli->parampage.imagepair) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (!prli->parampage.servparams.initiator) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; - return (FC_PARSE_OK); + return FC_PARSE_OK; } u16 @@ -462,7 +462,7 @@ fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, logo->nport_id = (s_id); logo->orig_port_name = port_name; - return (sizeof(struct fc_logo_s)); + return sizeof(struct fc_logo_s); } static u16 @@ -484,7 +484,7 @@ fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, adisc->orig_node_name = node_name; adisc->nport_id = (s_id); - return (sizeof(struct fc_adisc_s)); + return sizeof(struct fc_adisc_s); } u16 @@ -511,15 +511,15 @@ fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len, wwn_t port_name, { if (len < sizeof(struct fc_adisc_s)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (adisc->els_cmd.els_code != FC_ELS_ACC) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (!wwn_is_equal(adisc->orig_port_name, port_name)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; - return (FC_PARSE_OK); + return FC_PARSE_OK; } enum fc_parse_status @@ -529,14 +529,14 @@ fc_adisc_parse(struct fchs_s *fchs, void *pld, u32 host_dap, struct fc_adisc_s *adisc = (struct fc_adisc_s *) pld; if (adisc->els_cmd.els_code != FC_ELS_ACC) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if ((adisc->nport_id == (host_dap)) && wwn_is_equal(adisc->orig_port_name, port_name) && wwn_is_equal(adisc->orig_node_name, node_name)) - return (FC_PARSE_OK); + return FC_PARSE_OK; - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; } enum fc_parse_status @@ -550,13 +550,13 @@ fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name) if ((bfa_os_ntohs(pdisc->class3.rxsz) < (FC_MIN_PDUSZ - sizeof(struct fchs_s))) || (pdisc->class3.rxsz == 0)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (!wwn_is_equal(pdisc->port_name, port_name)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; if (!wwn_is_equal(pdisc->node_name, node_name)) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; return FC_PARSE_OK; } @@ -570,7 +570,7 @@ fc_abts_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) fchs->s_id = (s_id); fchs->ox_id = bfa_os_htons(ox_id); - return (sizeof(struct fchs_s)); + return sizeof(struct fchs_s); } enum fc_parse_status @@ -578,9 +578,9 @@ fc_abts_rsp_parse(struct fchs_s *fchs, int len) { if ((fchs->cat_info == FC_CAT_BA_ACC) || (fchs->cat_info == FC_CAT_BA_RJT)) - return (FC_PARSE_OK); + return FC_PARSE_OK; - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; } u16 @@ -597,7 +597,7 @@ fc_rrq_build(struct fchs_s *fchs, struct fc_rrq_s *rrq, u32 d_id, rrq->ox_id = bfa_os_htons(rrq_oxid); rrq->rx_id = FC_RXID_ANY; - return (sizeof(struct fc_rrq_s)); + return sizeof(struct fc_rrq_s); } u16 @@ -611,7 +611,7 @@ fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, memset(acc, 0, sizeof(struct fc_els_cmd_s)); acc->els_code = FC_ELS_ACC; - return (sizeof(struct fc_els_cmd_s)); + return sizeof(struct fc_els_cmd_s); } u16 @@ -627,7 +627,7 @@ fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, u32 d_id, ls_rjt->reason_code_expl = reason_code_expl; ls_rjt->vendor_unique = 0x00; - return (sizeof(struct fc_ls_rjt_s)); + return sizeof(struct fc_ls_rjt_s); } u16 @@ -643,7 +643,7 @@ fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id, ba_acc->ox_id = fchs->ox_id; ba_acc->rx_id = fchs->rx_id; - return (sizeof(struct fc_ba_acc_s)); + return sizeof(struct fc_ba_acc_s); } u16 @@ -654,7 +654,7 @@ fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, memset(els_cmd, 0, sizeof(struct fc_els_cmd_s)); els_cmd->els_code = FC_ELS_ACC; - return (sizeof(struct fc_els_cmd_s)); + return sizeof(struct fc_els_cmd_s); } int @@ -696,7 +696,7 @@ fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, tprlo_acc->tprlo_acc_params[page].orig_process_assc = 0; tprlo_acc->tprlo_acc_params[page].resp_process_assc = 0; } - return (bfa_os_ntohs(tprlo_acc->payload_len)); + return bfa_os_ntohs(tprlo_acc->payload_len); } u16 @@ -721,7 +721,7 @@ fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, prlo_acc->prlo_acc_params[page].resp_process_assc = 0; } - return (bfa_os_ntohs(prlo_acc->payload_len)); + return bfa_os_ntohs(prlo_acc->payload_len); } u16 @@ -735,7 +735,7 @@ fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, u32 d_id, rnid->els_cmd.els_code = FC_ELS_RNID; rnid->node_id_data_format = data_format; - return (sizeof(struct fc_rnid_cmd_s)); + return sizeof(struct fc_rnid_cmd_s); } u16 @@ -759,10 +759,10 @@ fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, rnid_acc->specific_id_data_length = sizeof(struct fc_rnid_general_topology_data_s); bfa_os_assign(rnid_acc->gen_topology_data, *gen_topo_data); - return (sizeof(struct fc_rnid_acc_s)); + return sizeof(struct fc_rnid_acc_s); } else { - return (sizeof(struct fc_rnid_acc_s) - - sizeof(struct fc_rnid_general_topology_data_s)); + return sizeof(struct fc_rnid_acc_s) - + sizeof(struct fc_rnid_general_topology_data_s); } } @@ -776,7 +776,7 @@ fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc, u32 d_id, memset(rpsc, 0, sizeof(struct fc_rpsc_cmd_s)); rpsc->els_cmd.els_code = FC_ELS_RPSC; - return (sizeof(struct fc_rpsc_cmd_s)); + return sizeof(struct fc_rpsc_cmd_s); } u16 @@ -797,8 +797,8 @@ fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, for (i = 0; i < npids; i++) rpsc2->pid_list[i].pid = pid_list[i]; - return (sizeof(struct fc_rpsc2_cmd_s) + ((npids - 1) * - (sizeof(u32)))); + return sizeof(struct fc_rpsc2_cmd_s) + ((npids - 1) * + (sizeof(u32))); } u16 @@ -819,7 +819,7 @@ fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc, rpsc_acc->speed_info[0].port_op_speed = bfa_os_htons(oper_speed->port_op_speed); - return (sizeof(struct fc_rpsc_acc_s)); + return sizeof(struct fc_rpsc_acc_s); } @@ -856,7 +856,7 @@ fc_pdisc_build(struct fchs_s *fchs, u32 d_id, u32 s_id, pdisc->port_name = port_name; pdisc->node_name = node_name; - return (sizeof(struct fc_logi_s)); + return sizeof(struct fc_logi_s); } u16 @@ -865,21 +865,21 @@ fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name) struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1); if (len < sizeof(struct fc_logi_s)) - return (FC_PARSE_LEN_INVAL); + return FC_PARSE_LEN_INVAL; if (pdisc->els_cmd.els_code != FC_ELS_ACC) - return (FC_PARSE_ACC_INVAL); + return FC_PARSE_ACC_INVAL; if (!wwn_is_equal(pdisc->port_name, port_name)) - return (FC_PARSE_PWWN_NOT_EQUAL); + return FC_PARSE_PWWN_NOT_EQUAL; if (!pdisc->class3.class_valid) - return (FC_PARSE_NWWN_NOT_EQUAL); + return FC_PARSE_NWWN_NOT_EQUAL; if (bfa_os_ntohs(pdisc->class3.rxsz) < (FC_MIN_PDUSZ)) - return (FC_PARSE_RXSZ_INVAL); + return FC_PARSE_RXSZ_INVAL; - return (FC_PARSE_OK); + return FC_PARSE_OK; } u16 @@ -903,7 +903,7 @@ fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id, prlo->prlo_params[page].resp_process_assc = 0; } - return (bfa_os_ntohs(prlo->payload_len)); + return bfa_os_ntohs(prlo->payload_len); } u16 @@ -916,7 +916,7 @@ fc_prlo_rsp_parse(struct fchs_s *fchs, int len) len = len; if (prlo->command != FC_ELS_ACC) - return (FC_PARSE_FAILURE); + return FC_PARSE_FAILURE; num_pages = ((bfa_os_ntohs(prlo->payload_len)) - 4) / 16; @@ -936,7 +936,7 @@ fc_prlo_rsp_parse(struct fchs_s *fchs, int len) if (prlo->prlo_acc_params[page].resp_process_assc != 0) return FC_PARSE_FAILURE; } - return (FC_PARSE_OK); + return FC_PARSE_OK; } @@ -968,7 +968,7 @@ fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, } } - return (bfa_os_ntohs(tprlo->payload_len)); + return bfa_os_ntohs(tprlo->payload_len); } u16 @@ -981,23 +981,23 @@ fc_tprlo_rsp_parse(struct fchs_s *fchs, int len) len = len; if (tprlo->command != FC_ELS_ACC) - return (FC_PARSE_ACC_INVAL); + return FC_PARSE_ACC_INVAL; num_pages = (bfa_os_ntohs(tprlo->payload_len) - 4) / 16; for (page = 0; page < num_pages; page++) { if (tprlo->tprlo_acc_params[page].type != FC_TYPE_FCP) - return (FC_PARSE_NOT_FCP); + return FC_PARSE_NOT_FCP; if (tprlo->tprlo_acc_params[page].opa_valid != 0) - return (FC_PARSE_OPAFLAG_INVAL); + return FC_PARSE_OPAFLAG_INVAL; if (tprlo->tprlo_acc_params[page].rpa_valid != 0) - return (FC_PARSE_RPAFLAG_INVAL); + return FC_PARSE_RPAFLAG_INVAL; if (tprlo->tprlo_acc_params[page].orig_process_assc != 0) - return (FC_PARSE_OPA_INVAL); + return FC_PARSE_OPA_INVAL; if (tprlo->tprlo_acc_params[page].resp_process_assc != 0) - return (FC_PARSE_RPA_INVAL); + return FC_PARSE_RPA_INVAL; } - return (FC_PARSE_OK); + return FC_PARSE_OK; } enum fc_parse_status @@ -1024,7 +1024,7 @@ fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, fchs->cat_info = FC_CAT_BA_RJT; ba_rjt->reason_code = reason_code; ba_rjt->reason_expl = reason_expl; - return (sizeof(struct fc_ba_rjt_s)); + return sizeof(struct fc_ba_rjt_s); } static void @@ -1073,7 +1073,7 @@ fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, bfa_os_memset(gidpn, 0, sizeof(struct fcgs_gidpn_req_s)); gidpn->port_name = port_name; - return (sizeof(struct fcgs_gidpn_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_gidpn_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1090,7 +1090,7 @@ fc_gpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, bfa_os_memset(gpnid, 0, sizeof(fcgs_gpnid_req_t)); gpnid->dap = port_id; - return (sizeof(fcgs_gpnid_req_t) + sizeof(struct ct_hdr_s)); + return sizeof(fcgs_gpnid_req_t) + sizeof(struct ct_hdr_s); } u16 @@ -1107,7 +1107,7 @@ fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, bfa_os_memset(gnnid, 0, sizeof(fcgs_gnnid_req_t)); gnnid->dap = port_id; - return (sizeof(fcgs_gnnid_req_t) + sizeof(struct ct_hdr_s)); + return sizeof(fcgs_gnnid_req_t) + sizeof(struct ct_hdr_s); } u16 @@ -1137,7 +1137,7 @@ fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr, u8 set_br_reg, if (set_br_reg) scr->vu_reg_func = FC_VU_SCR_REG_FUNC_FABRIC_NAME_CHANGE; - return (sizeof(struct fc_scr_s)); + return sizeof(struct fc_scr_s); } u16 @@ -1157,7 +1157,7 @@ fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn, u32 s_id, rscn->event[0].format = FC_RSCN_FORMAT_PORTID; rscn->event[0].portid = s_id; - return (sizeof(struct fc_rscn_pl_s)); + return sizeof(struct fc_rscn_pl_s); } u16 @@ -1188,7 +1188,7 @@ fc_rftid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, rftid->fc4_type[index] |= bfa_os_htonl(type_value); } - return (sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1210,7 +1210,7 @@ fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, bfa_os_memcpy((void *)rftid->fc4_type, (void *)fc4_bitmap, (bitmap_size < 32 ? bitmap_size : 32)); - return (sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1231,7 +1231,7 @@ fc_rffid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, rffid->fc4ftr_bits = fc4_ftrs; rffid->fc4_type = fc4_type; - return (sizeof(struct fcgs_rffid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rffid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1253,7 +1253,7 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, rspnid->spn_len = (u8) strlen((char *)name); strncpy((char *)rspnid->spn, (char *)name, rspnid->spn_len); - return (sizeof(struct fcgs_rspnid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rspnid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1275,7 +1275,7 @@ fc_gid_ft_build(struct fchs_s *fchs, void *pyld, u32 s_id, gidft->domain_id = 0; gidft->area_id = 0; - return (sizeof(struct fcgs_gidft_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_gidft_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1294,7 +1294,7 @@ fc_rpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, rpnid->port_id = port_id; rpnid->port_name = port_name; - return (sizeof(struct fcgs_rpnid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rpnid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1313,7 +1313,7 @@ fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, rnnid->port_id = port_id; rnnid->node_name = node_name; - return (sizeof(struct fcgs_rnnid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rnnid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1332,7 +1332,7 @@ fc_rcsid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, rcsid->port_id = port_id; rcsid->cos = cos; - return (sizeof(struct fcgs_rcsid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rcsid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1351,7 +1351,7 @@ fc_rptid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, rptid->port_id = port_id; rptid->port_type = port_type; - return (sizeof(struct fcgs_rptid_req_s) + sizeof(struct ct_hdr_s)); + return sizeof(struct fcgs_rptid_req_s) + sizeof(struct ct_hdr_s); } u16 @@ -1368,7 +1368,7 @@ fc_ganxt_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id) bfa_os_memset(ganxt, 0, sizeof(struct fcgs_ganxt_req_s)); ganxt->port_id = port_id; - return (sizeof(struct ct_hdr_s) + sizeof(struct fcgs_ganxt_req_s)); + return sizeof(struct ct_hdr_s) + sizeof(struct fcgs_ganxt_req_s); } /* @@ -1385,7 +1385,7 @@ fc_fdmi_reqhdr_build(struct fchs_s *fchs, void *pyld, u32 s_id, fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_fdmi_cthdr_build(cthdr, s_id, cmd_code); - return (sizeof(struct ct_hdr_s)); + return sizeof(struct ct_hdr_s); } /* @@ -1425,7 +1425,7 @@ fc_gmal_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn) bfa_os_memset(gmal, 0, sizeof(fcgs_gmal_req_t)); gmal->wwn = wwn; - return (sizeof(struct ct_hdr_s) + sizeof(fcgs_gmal_req_t)); + return sizeof(struct ct_hdr_s) + sizeof(fcgs_gmal_req_t); } /* @@ -1445,5 +1445,5 @@ fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn) bfa_os_memset(gfn, 0, sizeof(fcgs_gfn_req_t)); gfn->wwn = wwn; - return (sizeof(struct ct_hdr_s) + sizeof(fcgs_gfn_req_t)); + return sizeof(struct ct_hdr_s) + sizeof(fcgs_gfn_req_t); } diff --git a/drivers/scsi/bfa/fcbuild.h b/drivers/scsi/bfa/fcbuild.h index 4d248424f7b3..8fa7f270ef7b 100644 --- a/drivers/scsi/bfa/fcbuild.h +++ b/drivers/scsi/bfa/fcbuild.h @@ -32,8 +32,8 @@ * Utility Macros/functions */ -#define fcif_sof_set(_ifhdr, _sof) (_ifhdr)->sof = FC_ ## _sof -#define fcif_eof_set(_ifhdr, _eof) (_ifhdr)->eof = FC_ ## _eof +#define fcif_sof_set(_ifhdr, _sof) ((_ifhdr)->sof = FC_ ## _sof) +#define fcif_eof_set(_ifhdr, _eof) ((_ifhdr)->eof = FC_ ## _eof) #define wwn_is_equal(_wwn1, _wwn2) \ (memcmp(&(_wwn1), &(_wwn2), sizeof(wwn_t)) == 0) @@ -49,7 +49,7 @@ static inline u32 fc_get_ctresp_pyld_len(u32 resp_len) { - return (resp_len - sizeof(struct ct_hdr_s)); + return resp_len - sizeof(struct ct_hdr_s); } /* diff --git a/drivers/scsi/bfa/fcpim.c b/drivers/scsi/bfa/fcpim.c index 8ce5d8934677..1f3c06efaa9e 100644 --- a/drivers/scsi/bfa/fcpim.c +++ b/drivers/scsi/bfa/fcpim.c @@ -286,11 +286,10 @@ bfa_fcs_itnim_sm_online(struct bfa_fcs_itnim_s *itnim, bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_hcb_offline); bfa_fcb_itnim_offline(itnim->itnim_drv); bfa_itnim_offline(itnim->bfa_itnim); - if (bfa_fcs_port_is_online(itnim->rport->port) == BFA_TRUE) { + if (bfa_fcs_port_is_online(itnim->rport->port) == BFA_TRUE) bfa_fcs_itnim_aen_post(itnim, BFA_ITNIM_AEN_DISCONNECT); - } else { + else bfa_fcs_itnim_aen_post(itnim, BFA_ITNIM_AEN_OFFLINE); - } break; case BFA_FCS_ITNIM_SM_DELETE: @@ -732,7 +731,7 @@ bfa_fcs_itnim_lookup(struct bfa_fcs_port_s *port, wwn_t rpwwn) return NULL; bfa_assert(rport->itnim != NULL); - return (rport->itnim); + return rport->itnim; } bfa_status_t diff --git a/drivers/scsi/bfa/fcs.h b/drivers/scsi/bfa/fcs.h index deee685e8478..8d08230e6295 100644 --- a/drivers/scsi/bfa/fcs.h +++ b/drivers/scsi/bfa/fcs.h @@ -23,7 +23,7 @@ #ifndef __FCS_H__ #define __FCS_H__ -#define __fcs_min_cfg(__fcs) (__fcs)->min_cfg +#define __fcs_min_cfg(__fcs) ((__fcs)->min_cfg) void bfa_fcs_modexit_comp(struct bfa_fcs_s *fcs); diff --git a/drivers/scsi/bfa/fdmi.c b/drivers/scsi/bfa/fdmi.c index b845eb272c78..df2a1e54e16b 100644 --- a/drivers/scsi/bfa/fdmi.c +++ b/drivers/scsi/bfa/fdmi.c @@ -72,9 +72,9 @@ static u16 bfa_fcs_port_fdmi_build_rpa_pyld( struct bfa_fcs_port_fdmi_s *fdmi, u8 *pyld); static u16 bfa_fcs_port_fdmi_build_portattr_block( struct bfa_fcs_port_fdmi_s *fdmi, u8 *pyld); -void bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_port_fdmi_s *fdmi, +static void bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_port_fdmi_s *fdmi, struct bfa_fcs_fdmi_hba_attr_s *hba_attr); -void bfa_fcs_fdmi_get_portattr(struct bfa_fcs_port_fdmi_s *fdmi, +static void bfa_fcs_fdmi_get_portattr(struct bfa_fcs_port_fdmi_s *fdmi, struct bfa_fcs_fdmi_port_attr_s *port_attr); /** * fcs_fdmi_sm FCS FDMI state machine @@ -1091,7 +1091,7 @@ bfa_fcs_port_fdmi_timeout(void *arg) bfa_sm_send_event(fdmi, FDMISM_EVENT_TIMEOUT); } -void +static void bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_port_fdmi_s *fdmi, struct bfa_fcs_fdmi_hba_attr_s *hba_attr) { @@ -1145,7 +1145,7 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_port_fdmi_s *fdmi, } -void +static void bfa_fcs_fdmi_get_portattr(struct bfa_fcs_port_fdmi_s *fdmi, struct bfa_fcs_fdmi_port_attr_s *port_attr) { diff --git a/drivers/scsi/bfa/include/aen/bfa_aen.h b/drivers/scsi/bfa/include/aen/bfa_aen.h index da8cac093d3d..d9cbc2a783d4 100644 --- a/drivers/scsi/bfa/include/aen/bfa_aen.h +++ b/drivers/scsi/bfa/include/aen/bfa_aen.h @@ -54,7 +54,7 @@ bfa_aen_get_max_cfg_entry(void) static inline s32 bfa_aen_get_meminfo(void) { - return (sizeof(struct bfa_aen_entry_s) * bfa_aen_get_max_cfg_entry()); + return sizeof(struct bfa_aen_entry_s) * bfa_aen_get_max_cfg_entry(); } static inline s32 diff --git a/drivers/scsi/bfa/include/bfa.h b/drivers/scsi/bfa/include/bfa.h index 64c1412c5703..d4bc0d9fa42c 100644 --- a/drivers/scsi/bfa/include/bfa.h +++ b/drivers/scsi/bfa/include/bfa.h @@ -76,11 +76,11 @@ struct bfa_meminfo_s { struct bfa_mem_elem_s meminfo[BFA_MEM_TYPE_MAX]; }; #define bfa_meminfo_kva(_m) \ - (_m)->meminfo[BFA_MEM_TYPE_KVA - 1].kva_curp + ((_m)->meminfo[BFA_MEM_TYPE_KVA - 1].kva_curp) #define bfa_meminfo_dma_virt(_m) \ - (_m)->meminfo[BFA_MEM_TYPE_DMA - 1].kva_curp + ((_m)->meminfo[BFA_MEM_TYPE_DMA - 1].kva_curp) #define bfa_meminfo_dma_phys(_m) \ - (_m)->meminfo[BFA_MEM_TYPE_DMA - 1].dma_curp + ((_m)->meminfo[BFA_MEM_TYPE_DMA - 1].dma_curp) /** * Generic Scatter Gather Element used by driver @@ -100,7 +100,7 @@ struct bfa_sge_s { /* * bfa stats interfaces */ -#define bfa_stats(_mod, _stats) (_mod)->stats._stats ++ +#define bfa_stats(_mod, _stats) ((_mod)->stats._stats++) #define bfa_ioc_get_stats(__bfa, __ioc_stats) \ bfa_ioc_fetch_stats(&(__bfa)->ioc, __ioc_stats) @@ -136,7 +136,7 @@ void bfa_isr_enable(struct bfa_s *bfa); void bfa_isr_disable(struct bfa_s *bfa); void bfa_msix_getvecs(struct bfa_s *bfa, u32 *msix_vecs_bmap, u32 *num_vecs, u32 *max_vec_bit); -#define bfa_msix(__bfa, __vec) (__bfa)->msix.handler[__vec](__bfa, __vec) +#define bfa_msix(__bfa, __vec) ((__bfa)->msix.handler[__vec](__bfa, __vec)) void bfa_comp_deq(struct bfa_s *bfa, struct list_head *comp_q); void bfa_comp_process(struct bfa_s *bfa, struct list_head *comp_q); diff --git a/drivers/scsi/bfa/include/bfa_svc.h b/drivers/scsi/bfa/include/bfa_svc.h index 0c80b74f72ef..268d956bad89 100644 --- a/drivers/scsi/bfa/include/bfa_svc.h +++ b/drivers/scsi/bfa/include/bfa_svc.h @@ -34,10 +34,10 @@ struct bfa_fcxp_s; */ struct bfa_rport_info_s { u16 max_frmsz; /* max rcv pdu size */ - u32 pid : 24, /* remote port ID */ - lp_tag : 8; - u32 local_pid : 24, /* local port ID */ - cisc : 8; /* CIRO supported */ + u32 pid:24, /* remote port ID */ + lp_tag:8; + u32 local_pid:24, /* local port ID */ + cisc:8; /* CIRO supported */ u8 fc_class; /* supported FC classes. enum fc_cos */ u8 vf_en; /* virtual fabric enable */ u16 vf_id; /* virtual fabric ID */ diff --git a/drivers/scsi/bfa/include/bfi/bfi.h b/drivers/scsi/bfa/include/bfi/bfi.h index 6cadfe0d4ba1..7042c18e542d 100644 --- a/drivers/scsi/bfa/include/bfi/bfi.h +++ b/drivers/scsi/bfa/include/bfi/bfi.h @@ -93,13 +93,13 @@ union bfi_addr_u { */ struct bfi_sge_s { #ifdef __BIGENDIAN - u32 flags : 2, - rsvd : 2, - sg_len : 28; + u32 flags:2, + rsvd:2, + sg_len:28; #else - u32 sg_len : 28, - rsvd : 2, - flags : 2; + u32 sg_len:28, + rsvd:2, + flags:2; #endif union bfi_addr_u sga; }; diff --git a/drivers/scsi/bfa/include/bfi/bfi_ioc.h b/drivers/scsi/bfa/include/bfi/bfi_ioc.h index 026e9c06ae97..96ef05670659 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_ioc.h +++ b/drivers/scsi/bfa/include/bfi/bfi_ioc.h @@ -142,7 +142,7 @@ enum { BFI_ADAPTER_UNSUPP = 0x400000, /* unknown adapter type */ }; -#define BFI_ADAPTER_GETP(__prop,__adap_prop) \ +#define BFI_ADAPTER_GETP(__prop, __adap_prop) \ (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \ BFI_ADAPTER_ ## __prop ## _SH) #define BFI_ADAPTER_SETP(__prop, __val) \ diff --git a/drivers/scsi/bfa/include/bfi/bfi_lps.h b/drivers/scsi/bfa/include/bfi/bfi_lps.h index 414b0e30f6ef..c59d47badb4b 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_lps.h +++ b/drivers/scsi/bfa/include/bfi/bfi_lps.h @@ -55,8 +55,8 @@ struct bfi_lps_login_rsp_s { u16 bb_credit; u8 f_port; u8 npiv_en; - u32 lp_pid : 24; - u32 auth_req : 8; + u32 lp_pid:24; + u32 auth_req:8; mac_t lp_mac; mac_t fcf_mac; u8 ext_status; diff --git a/drivers/scsi/bfa/include/bfi/bfi_rport.h b/drivers/scsi/bfa/include/bfi/bfi_rport.h index 3520f55f09d7..e1cd83b56ec6 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_rport.h +++ b/drivers/scsi/bfa/include/bfi/bfi_rport.h @@ -38,10 +38,10 @@ struct bfi_rport_create_req_s { struct bfi_mhdr_s mh; /* common msg header */ u16 bfa_handle; /* host rport handle */ u16 max_frmsz; /* max rcv pdu size */ - u32 pid : 24, /* remote port ID */ - lp_tag : 8; /* local port tag */ - u32 local_pid : 24, /* local port ID */ - cisc : 8; + u32 pid:24, /* remote port ID */ + lp_tag:8; /* local port tag */ + u32 local_pid:24, /* local port ID */ + cisc:8; u8 fc_class; /* supported FC classes */ u8 vf_en; /* virtual fabric enable */ u16 vf_id; /* virtual fabric ID */ diff --git a/drivers/scsi/bfa/include/cs/bfa_checksum.h b/drivers/scsi/bfa/include/cs/bfa_checksum.h index af8c1d533ba8..650f8d0aaff9 100644 --- a/drivers/scsi/bfa/include/cs/bfa_checksum.h +++ b/drivers/scsi/bfa/include/cs/bfa_checksum.h @@ -31,7 +31,7 @@ bfa_checksum_u32(u32 *buf, int sz) for (i = 0; i < m; i++) sum ^= buf[i]; - return (sum); + return sum; } static inline u16 @@ -43,7 +43,7 @@ bfa_checksum_u16(u16 *buf, int sz) for (i = 0; i < m; i++) sum ^= buf[i]; - return (sum); + return sum; } static inline u8 @@ -55,6 +55,6 @@ bfa_checksum_u8(u8 *buf, int sz) for (i = 0; i < sz; i++) sum ^= buf[i]; - return (sum); + return sum; } #endif diff --git a/drivers/scsi/bfa/include/cs/bfa_sm.h b/drivers/scsi/bfa/include/cs/bfa_sm.h index 9877066680a6..b0a92baf6657 100644 --- a/drivers/scsi/bfa/include/cs/bfa_sm.h +++ b/drivers/scsi/bfa/include/cs/bfa_sm.h @@ -24,8 +24,8 @@ typedef void (*bfa_sm_t)(void *sm, int event); -#define bfa_sm_set_state(_sm, _state) (_sm)->sm = (bfa_sm_t)(_state) -#define bfa_sm_send_event(_sm, _event) (_sm)->sm((_sm), (_event)) +#define bfa_sm_set_state(_sm, _state) ((_sm)->sm = (bfa_sm_t)(_state)) +#define bfa_sm_send_event(_sm, _event) ((_sm)->sm((_sm), (_event))) #define bfa_sm_get_state(_sm) ((_sm)->sm) #define bfa_sm_cmp_state(_sm, _state) ((_sm)->sm == (bfa_sm_t)(_state)) @@ -62,7 +62,7 @@ typedef void (*bfa_fsm_t)(void *fsm, int event); } while (0) #define bfa_fsm_send_event(_fsm, _event) \ - (_fsm)->fsm((_fsm), (_event)) + ((_fsm)->fsm((_fsm), (_event))) #define bfa_fsm_cmp_state(_fsm, _state) \ ((_fsm)->fsm == (bfa_fsm_t)(_state)) diff --git a/drivers/scsi/bfa/include/cs/bfa_trc.h b/drivers/scsi/bfa/include/cs/bfa_trc.h index 3e743928c74c..310771c888e7 100644 --- a/drivers/scsi/bfa/include/cs/bfa_trc.h +++ b/drivers/scsi/bfa/include/cs/bfa_trc.h @@ -24,7 +24,7 @@ #endif #ifndef BFA_TRC_TS -#define BFA_TRC_TS(_trcm) ((_trcm)->ticks ++) +#define BFA_TRC_TS(_trcm) ((_trcm)->ticks++) #endif struct bfa_trc_s { diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs_fabric.h b/drivers/scsi/bfa/include/fcs/bfa_fcs_fabric.h index 4ffd2242d3de..08b79d5e46f3 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs_fabric.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs_fabric.h @@ -75,7 +75,7 @@ struct bfa_fcs_fabric_s { */ }; -#define bfa_fcs_fabric_npiv_capable(__f) (__f)->is_npiv +#define bfa_fcs_fabric_npiv_capable(__f) ((__f)->is_npiv) #define bfa_fcs_fabric_is_switched(__f) \ ((__f)->fab_type == BFA_FCS_FABRIC_SWITCHED) diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs_lport.h b/drivers/scsi/bfa/include/fcs/bfa_fcs_lport.h index b85cba884b96..967ceb0eb074 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs_lport.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs_lport.h @@ -125,12 +125,12 @@ union bfa_fcs_port_topo_u { struct bfa_fcs_port_s { struct list_head qe; /* used by port/vport */ bfa_sm_t sm; /* state machine */ - struct bfa_fcs_fabric_s *fabric; /* parent fabric */ - struct bfa_port_cfg_s port_cfg; /* port configuration */ + struct bfa_fcs_fabric_s *fabric;/* parent fabric */ + struct bfa_port_cfg_s port_cfg;/* port configuration */ struct bfa_timer_s link_timer; /* timer for link offline */ - u32 pid : 24; /* FC address */ - u8 lp_tag; /* lport tag */ - u16 num_rports; /* Num of r-ports */ + u32 pid:24; /* FC address */ + u8 lp_tag; /* lport tag */ + u16 num_rports; /* Num of r-ports */ struct list_head rport_q; /* queue of discovered r-ports */ struct bfa_fcs_s *fcs; /* FCS instance */ union bfa_fcs_port_topo_u port_topo; /* fabric/loop/n2n details */ @@ -188,13 +188,14 @@ bfa_fcs_port_get_drvport(struct bfa_fcs_port_s *port) } -#define bfa_fcs_port_get_opertype(_lport) (_lport)->fabric->oper_type +#define bfa_fcs_port_get_opertype(_lport) ((_lport)->fabric->oper_type) -#define bfa_fcs_port_get_fabric_name(_lport) (_lport)->fabric->fabric_name +#define bfa_fcs_port_get_fabric_name(_lport) ((_lport)->fabric->fabric_name) -#define bfa_fcs_port_get_fabric_ipaddr(_lport) (_lport)->fabric->fabric_ip_addr +#define bfa_fcs_port_get_fabric_ipaddr(_lport) \ + ((_lport)->fabric->fabric_ip_addr) /** * bfa fcs port public functions diff --git a/drivers/scsi/bfa/include/protocol/ct.h b/drivers/scsi/bfa/include/protocol/ct.h index c59d6630b070..c8648bcba41a 100644 --- a/drivers/scsi/bfa/include/protocol/ct.h +++ b/drivers/scsi/bfa/include/protocol/ct.h @@ -193,11 +193,11 @@ struct fcgs_rftid_req_s { #define FC_GS_FCP_FC4_FEATURE_TARGET 0x01 struct fcgs_rffid_req_s{ - u32 rsvd :8; - u32 dap :24; /* port identifier */ - u32 rsvd1 :16; - u32 fc4ftr_bits :8; /* fc4 feature bits */ - u32 fc4_type :8; /* corresponding FC4 Type */ + u32 rsvd:8; + u32 dap:24; /* port identifier */ + u32 rsvd1:16; + u32 fc4ftr_bits:8; /* fc4 feature bits */ + u32 fc4_type:8; /* corresponding FC4 Type */ }; /** diff --git a/drivers/scsi/bfa/include/protocol/fc.h b/drivers/scsi/bfa/include/protocol/fc.h index 3e39ba58cfb5..14969eecf6a9 100644 --- a/drivers/scsi/bfa/include/protocol/fc.h +++ b/drivers/scsi/bfa/include/protocol/fc.h @@ -486,14 +486,14 @@ struct fc_rsi_s { * see FC-PH-X table 113 & 115 for explanation also FCP table 8 */ struct fc_prli_params_s{ - u32 reserved: 16; + u32 reserved:16; #ifdef __BIGENDIAN - u32 reserved1: 5; - u32 rec_support : 1; - u32 task_retry_id : 1; - u32 retry : 1; + u32 reserved1:5; + u32 rec_support:1; + u32 task_retry_id:1; + u32 retry:1; - u32 confirm : 1; + u32 confirm:1; u32 doverlay:1; u32 initiator:1; u32 target:1; @@ -502,10 +502,10 @@ struct fc_prli_params_s{ u32 rxrdisab:1; u32 wxrdisab:1; #else - u32 retry : 1; - u32 task_retry_id : 1; - u32 rec_support : 1; - u32 reserved1: 5; + u32 retry:1; + u32 task_retry_id:1; + u32 rec_support:1; + u32 reserved1:5; u32 wxrdisab:1; u32 rxrdisab:1; @@ -514,7 +514,7 @@ struct fc_prli_params_s{ u32 target:1; u32 initiator:1; u32 doverlay:1; - u32 confirm : 1; + u32 confirm:1; #endif }; diff --git a/drivers/scsi/bfa/loop.c b/drivers/scsi/bfa/loop.c index a418dedebe9e..f7c7f4f3c640 100644 --- a/drivers/scsi/bfa/loop.c +++ b/drivers/scsi/bfa/loop.c @@ -58,49 +58,16 @@ static const u8 port_loop_alpa_map[] = { /* * Local Functions */ -bfa_status_t bfa_fcs_port_loop_send_plogi(struct bfa_fcs_port_s *port, - u8 alpa); - -void bfa_fcs_port_loop_plogi_response(void *fcsarg, - struct bfa_fcxp_s *fcxp, - void *cbarg, - bfa_status_t req_status, - u32 rsp_len, - u32 resid_len, - struct fchs_s *rsp_fchs); - -bfa_status_t bfa_fcs_port_loop_send_adisc(struct bfa_fcs_port_s *port, - u8 alpa); - -void bfa_fcs_port_loop_adisc_response(void *fcsarg, - struct bfa_fcxp_s *fcxp, - void *cbarg, - bfa_status_t req_status, - u32 rsp_len, - u32 resid_len, - struct fchs_s *rsp_fchs); - -bfa_status_t bfa_fcs_port_loop_send_plogi_acc(struct bfa_fcs_port_s *port, - u8 alpa); - -void bfa_fcs_port_loop_plogi_acc_response(void *fcsarg, - struct bfa_fcxp_s *fcxp, - void *cbarg, - bfa_status_t req_status, - u32 rsp_len, - u32 resid_len, - struct fchs_s *rsp_fchs); - -bfa_status_t bfa_fcs_port_loop_send_adisc_acc(struct bfa_fcs_port_s *port, - u8 alpa); - -void bfa_fcs_port_loop_adisc_acc_response(void *fcsarg, - struct bfa_fcxp_s *fcxp, - void *cbarg, - bfa_status_t req_status, - u32 rsp_len, - u32 resid_len, - struct fchs_s *rsp_fchs); +static bfa_status_t bfa_fcs_port_loop_send_plogi(struct bfa_fcs_port_s *port, + u8 alpa); + +static void bfa_fcs_port_loop_plogi_response(void *fcsarg, + struct bfa_fcxp_s *fcxp, + void *cbarg, + bfa_status_t req_status, + u32 rsp_len, + u32 resid_len, + struct fchs_s *rsp_fchs); /** * Called by port to initializar in provate LOOP topology. */ @@ -179,7 +146,7 @@ bfa_fcs_port_loop_lip(struct bfa_fcs_port_s *port) /** * Local Functions. */ -bfa_status_t +static bfa_status_t bfa_fcs_port_loop_send_plogi(struct bfa_fcs_port_s *port, u8 alpa) { struct fchs_s fchs; @@ -208,7 +175,7 @@ bfa_fcs_port_loop_send_plogi(struct bfa_fcs_port_s *port, u8 alpa) /** * Called by fcxp to notify the Plogi response */ -void +static void bfa_fcs_port_loop_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, bfa_status_t req_status, u32 rsp_len, u32 resid_len, @@ -244,179 +211,3 @@ bfa_fcs_port_loop_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp, bfa_assert(0); } } - -bfa_status_t -bfa_fcs_port_loop_send_plogi_acc(struct bfa_fcs_port_s *port, u8 alpa) -{ - struct fchs_s fchs; - struct bfa_fcxp_s *fcxp; - int len; - - bfa_trc(port->fcs, alpa); - - fcxp = bfa_fcxp_alloc(NULL, port->fcs->bfa, 0, 0, NULL, NULL, NULL, - NULL); - bfa_assert(fcxp); - - len = fc_plogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), alpa, - bfa_fcs_port_get_fcid(port), 0, - port->port_cfg.pwwn, port->port_cfg.nwwn, - bfa_pport_get_maxfrsize(port->fcs->bfa)); - - bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, - FC_CLASS_3, len, &fchs, - bfa_fcs_port_loop_plogi_acc_response, - (void *)port, FC_MAX_PDUSZ, 0); /* No response - * expected - */ - - return BFA_STATUS_OK; -} - -/* - * Plogi Acc Response - * We donot do any processing here. - */ -void -bfa_fcs_port_loop_plogi_acc_response(void *fcsarg, struct bfa_fcxp_s *fcxp, - void *cbarg, bfa_status_t req_status, - u32 rsp_len, u32 resid_len, - struct fchs_s *rsp_fchs) -{ - - struct bfa_fcs_port_s *port = (struct bfa_fcs_port_s *) cbarg; - - bfa_trc(port->fcs, port->pid); - - /* - * Sanity Checks - */ - if (req_status != BFA_STATUS_OK) { - bfa_trc(port->fcs, req_status); - return; - } -} - -bfa_status_t -bfa_fcs_port_loop_send_adisc(struct bfa_fcs_port_s *port, u8 alpa) -{ - struct fchs_s fchs; - struct bfa_fcxp_s *fcxp; - int len; - - bfa_trc(port->fcs, alpa); - - fcxp = bfa_fcxp_alloc(NULL, port->fcs->bfa, 0, 0, NULL, NULL, NULL, - NULL); - bfa_assert(fcxp); - - len = fc_adisc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), alpa, - bfa_fcs_port_get_fcid(port), 0, - port->port_cfg.pwwn, port->port_cfg.nwwn); - - bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, - FC_CLASS_3, len, &fchs, - bfa_fcs_port_loop_adisc_response, (void *)port, - FC_MAX_PDUSZ, FC_RA_TOV); - - return BFA_STATUS_OK; -} - -/** - * Called by fcxp to notify the ADISC response - */ -void -bfa_fcs_port_loop_adisc_response(void *fcsarg, struct bfa_fcxp_s *fcxp, - void *cbarg, bfa_status_t req_status, - u32 rsp_len, u32 resid_len, - struct fchs_s *rsp_fchs) -{ - struct bfa_fcs_port_s *port = (struct bfa_fcs_port_s *) cbarg; - struct bfa_fcs_rport_s *rport; - struct fc_adisc_s *adisc_resp; - struct fc_els_cmd_s *els_cmd; - u32 pid = rsp_fchs->s_id; - - bfa_trc(port->fcs, req_status); - - /* - * Sanity Checks - */ - if (req_status != BFA_STATUS_OK) { - /* - * TBD : we may need to retry certain requests - */ - bfa_fcxp_free(fcxp); - return; - } - - els_cmd = (struct fc_els_cmd_s *) BFA_FCXP_RSP_PLD(fcxp); - adisc_resp = (struct fc_adisc_s *) els_cmd; - - if (els_cmd->els_code == FC_ELS_ACC) { - } else { - bfa_trc(port->fcs, adisc_resp->els_cmd.els_code); - - /* - * TBD: we may need to check for reject codes and retry - */ - rport = bfa_fcs_port_get_rport_by_pid(port, pid); - if (rport) { - list_del(&rport->qe); - bfa_fcs_rport_delete(rport); - } - - } - return; -} - -bfa_status_t -bfa_fcs_port_loop_send_adisc_acc(struct bfa_fcs_port_s *port, u8 alpa) -{ - struct fchs_s fchs; - struct bfa_fcxp_s *fcxp; - int len; - - bfa_trc(port->fcs, alpa); - - fcxp = bfa_fcxp_alloc(NULL, port->fcs->bfa, 0, 0, NULL, NULL, NULL, - NULL); - bfa_assert(fcxp); - - len = fc_adisc_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), alpa, - bfa_fcs_port_get_fcid(port), 0, - port->port_cfg.pwwn, port->port_cfg.nwwn); - - bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, - FC_CLASS_3, len, &fchs, - bfa_fcs_port_loop_adisc_acc_response, - (void *)port, FC_MAX_PDUSZ, 0); /* no reponse - * expected - */ - - return BFA_STATUS_OK; -} - -/* - * Adisc Acc Response - * We donot do any processing here. - */ -void -bfa_fcs_port_loop_adisc_acc_response(void *fcsarg, struct bfa_fcxp_s *fcxp, - void *cbarg, bfa_status_t req_status, - u32 rsp_len, u32 resid_len, - struct fchs_s *rsp_fchs) -{ - - struct bfa_fcs_port_s *port = (struct bfa_fcs_port_s *) cbarg; - - bfa_trc(port->fcs, port->pid); - - /* - * Sanity Checks - */ - if (req_status != BFA_STATUS_OK) { - bfa_trc(port->fcs, req_status); - return; - } -} diff --git a/drivers/scsi/bfa/lport_api.c b/drivers/scsi/bfa/lport_api.c index 8f51a83f1834..1e06792cd4c2 100644 --- a/drivers/scsi/bfa/lport_api.c +++ b/drivers/scsi/bfa/lport_api.c @@ -43,7 +43,7 @@ bfa_fcs_cfg_base_port(struct bfa_fcs_s *fcs, struct bfa_port_cfg_s *port_cfg) struct bfa_fcs_port_s * bfa_fcs_get_base_port(struct bfa_fcs_s *fcs) { - return (&fcs->fabric.bport); + return &fcs->fabric.bport; } wwn_t @@ -88,11 +88,10 @@ bfa_fcs_port_get_rport(struct bfa_fcs_port_s *port, wwn_t wwn, int index, } bfa_trc(fcs, i); - if (rport) { + if (rport) return rport->pwwn; - } else { + else return (wwn_t) 0; - } } void @@ -198,17 +197,17 @@ bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, u16 vf_id, wwn_t lpwwn) vf = bfa_fcs_vf_lookup(fcs, vf_id); if (vf == NULL) { bfa_trc(fcs, vf_id); - return (NULL); + return NULL; } if (!lpwwn || (vf->bport.port_cfg.pwwn == lpwwn)) - return (&vf->bport); + return &vf->bport; vport = bfa_fcs_fabric_vport_lookup(vf, lpwwn); if (vport) - return (&vport->lport); + return &vport->lport; - return (NULL); + return NULL; } /* diff --git a/drivers/scsi/bfa/ns.c b/drivers/scsi/bfa/ns.c index 59fea99d67a4..2f8b880060bb 100644 --- a/drivers/scsi/bfa/ns.c +++ b/drivers/scsi/bfa/ns.c @@ -932,11 +932,10 @@ bfa_fcs_port_ns_send_rff_id(void *ns_cbarg, struct bfa_fcxp_s *fcxp_alloced) } ns->fcxp = fcxp; - if (BFA_FCS_VPORT_IS_INITIATOR_MODE(ns->port)) { + if (BFA_FCS_VPORT_IS_INITIATOR_MODE(ns->port)) fc4_ftrs = FC_GS_FCP_FC4_FEATURE_INITIATOR; - } else if (BFA_FCS_VPORT_IS_TARGET_MODE(ns->port)) { + else if (BFA_FCS_VPORT_IS_TARGET_MODE(ns->port)) fc4_ftrs = FC_GS_FCP_FC4_FEATURE_TARGET; - } len = fc_rffid_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), bfa_fcs_port_get_fcid(port), 0, FC_TYPE_FCP, diff --git a/drivers/scsi/bfa/plog.c b/drivers/scsi/bfa/plog.c index 86af818d17bb..fcb8864d3276 100644 --- a/drivers/scsi/bfa/plog.c +++ b/drivers/scsi/bfa/plog.c @@ -180,5 +180,5 @@ bfa_plog_disable(struct bfa_plog_s *plog) bfa_boolean_t bfa_plog_get_setting(struct bfa_plog_s *plog) { - return((bfa_boolean_t)plog->plog_enabled); + return (bfa_boolean_t)plog->plog_enabled; } diff --git a/drivers/scsi/bfa/rport_ftrs.c b/drivers/scsi/bfa/rport_ftrs.c index 8a1f59d596c1..e1932c885ac2 100644 --- a/drivers/scsi/bfa/rport_ftrs.c +++ b/drivers/scsi/bfa/rport_ftrs.c @@ -79,7 +79,7 @@ bfa_fcs_rpf_sm_uninit(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) bfa_trc(rport->fcs, event); switch (event) { - case RPFSM_EVENT_RPORT_ONLINE : + case RPFSM_EVENT_RPORT_ONLINE: if (!BFA_FCS_PID_IS_WKA(rport->pid)) { bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending); rpf->rpsc_retries = 0; @@ -87,7 +87,7 @@ bfa_fcs_rpf_sm_uninit(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) break; }; - case RPFSM_EVENT_RPORT_OFFLINE : + case RPFSM_EVENT_RPORT_OFFLINE: break; default: @@ -107,7 +107,7 @@ bfa_fcs_rpf_sm_rpsc_sending(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc); break; - case RPFSM_EVENT_RPORT_OFFLINE : + case RPFSM_EVENT_RPORT_OFFLINE: bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_offline); bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rpf->fcxp_wqe); rpf->rpsc_retries = 0; @@ -130,11 +130,10 @@ bfa_fcs_rpf_sm_rpsc(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) case RPFSM_EVENT_RPSC_COMP: bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_online); /* Update speed info in f/w via BFA */ - if (rpf->rpsc_speed != BFA_PPORT_SPEED_UNKNOWN) { + if (rpf->rpsc_speed != BFA_PPORT_SPEED_UNKNOWN) bfa_rport_speed(rport->bfa_rport, rpf->rpsc_speed); - } else if (rpf->assigned_speed != BFA_PPORT_SPEED_UNKNOWN) { + else if (rpf->assigned_speed != BFA_PPORT_SPEED_UNKNOWN) bfa_rport_speed(rport->bfa_rport, rpf->assigned_speed); - } break; case RPFSM_EVENT_RPSC_FAIL: @@ -154,7 +153,7 @@ bfa_fcs_rpf_sm_rpsc(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) } break; - case RPFSM_EVENT_RPORT_OFFLINE : + case RPFSM_EVENT_RPORT_OFFLINE: bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_offline); bfa_fcxp_discard(rpf->fcxp); rpf->rpsc_retries = 0; @@ -174,13 +173,13 @@ bfa_fcs_rpf_sm_rpsc_retry(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) bfa_trc(rport->fcs, event); switch (event) { - case RPFSM_EVENT_TIMEOUT : + case RPFSM_EVENT_TIMEOUT: /* re-send the RPSC */ bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending); bfa_fcs_rpf_send_rpsc2(rpf, NULL); break; - case RPFSM_EVENT_RPORT_OFFLINE : + case RPFSM_EVENT_RPORT_OFFLINE: bfa_timer_stop(&rpf->timer); bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_offline); rpf->rpsc_retries = 0; @@ -201,7 +200,7 @@ bfa_fcs_rpf_sm_online(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) bfa_trc(rport->fcs, event); switch (event) { - case RPFSM_EVENT_RPORT_OFFLINE : + case RPFSM_EVENT_RPORT_OFFLINE: bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_offline); rpf->rpsc_retries = 0; break; @@ -221,12 +220,12 @@ bfa_fcs_rpf_sm_offline(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) bfa_trc(rport->fcs, event); switch (event) { - case RPFSM_EVENT_RPORT_ONLINE : + case RPFSM_EVENT_RPORT_ONLINE: bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending); bfa_fcs_rpf_send_rpsc2(rpf, NULL); break; - case RPFSM_EVENT_RPORT_OFFLINE : + case RPFSM_EVENT_RPORT_OFFLINE: break; default: @@ -366,10 +365,9 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, bfa_trc(rport->fcs, ls_rjt->reason_code); bfa_trc(rport->fcs, ls_rjt->reason_code_expl); rport->stats.rpsc_rejects++; - if (ls_rjt->reason_code == FC_LS_RJT_RSN_CMD_NOT_SUPP) { + if (ls_rjt->reason_code == FC_LS_RJT_RSN_CMD_NOT_SUPP) bfa_sm_send_event(rpf, RPFSM_EVENT_RPSC_FAIL); - } else { + else bfa_sm_send_event(rpf, RPFSM_EVENT_RPSC_ERROR); - } } } diff --git a/drivers/scsi/bfa/vfapi.c b/drivers/scsi/bfa/vfapi.c index 31d81fe2fc48..391a4790bebd 100644 --- a/drivers/scsi/bfa/vfapi.c +++ b/drivers/scsi/bfa/vfapi.c @@ -189,7 +189,7 @@ bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id) { bfa_trc(fcs, vf_id); if (vf_id == FC_VF_ID_NULL) - return (&fcs->fabric); + return &fcs->fabric; /** * @todo vf support diff --git a/drivers/scsi/bfa/vport.c b/drivers/scsi/bfa/vport.c index c10af06c5714..e90f1e38c32d 100644 --- a/drivers/scsi/bfa/vport.c +++ b/drivers/scsi/bfa/vport.c @@ -31,13 +31,13 @@ BFA_TRC_FILE(FCS, VPORT); -#define __vport_fcs(__vp) (__vp)->lport.fcs -#define __vport_pwwn(__vp) (__vp)->lport.port_cfg.pwwn -#define __vport_nwwn(__vp) (__vp)->lport.port_cfg.nwwn -#define __vport_bfa(__vp) (__vp)->lport.fcs->bfa -#define __vport_fcid(__vp) (__vp)->lport.pid -#define __vport_fabric(__vp) (__vp)->lport.fabric -#define __vport_vfid(__vp) (__vp)->lport.fabric->vf_id +#define __vport_fcs(__vp) ((__vp)->lport.fcs) +#define __vport_pwwn(__vp) ((__vp)->lport.port_cfg.pwwn) +#define __vport_nwwn(__vp) ((__vp)->lport.port_cfg.nwwn) +#define __vport_bfa(__vp) ((__vp)->lport.fcs->bfa) +#define __vport_fcid(__vp) ((__vp)->lport.pid) +#define __vport_fabric(__vp) ((__vp)->lport.fabric) +#define __vport_vfid(__vp) ((__vp)->lport.fabric->vf_id) #define BFA_FCS_VPORT_MAX_RETRIES 5 /* @@ -641,9 +641,9 @@ bfa_fcs_vport_get_max(struct bfa_fcs_s *fcs) bfa_get_attr(fcs->bfa, &ioc_attr); if (ioc_attr.pci_attr.device_id == BFA_PCI_DEVICE_ID_CT) - return (BFA_FCS_MAX_VPORTS_SUPP_CT); + return BFA_FCS_MAX_VPORTS_SUPP_CT; else - return (BFA_FCS_MAX_VPORTS_SUPP_CB); + return BFA_FCS_MAX_VPORTS_SUPP_CB; } @@ -675,7 +675,7 @@ bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs, struct bfad_vport_s *vport_drv) { if (vport_cfg->pwwn == 0) - return (BFA_STATUS_INVALID_WWN); + return BFA_STATUS_INVALID_WWN; if (bfa_fcs_port_get_pwwn(&fcs->fabric.bport) == vport_cfg->pwwn) return BFA_STATUS_VPORT_WWN_BP; |