diff options
author | Jing Huang <huangj@brocade.com> | 2010-12-27 00:46:35 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-31 10:36:53 -0500 |
commit | d4b671c58ebeb56dfc8fe8bcca25e0a06bc9359a (patch) | |
tree | f8b5a2cc309ce68dc4399922fe01341d2a332aa0 /drivers/scsi/bfa/bfa_svc.c | |
parent | aa5cbf8a70f57c5360ce1bfef692b357c866ae7f (diff) |
[SCSI] bfa: replace bfa_assert with WARN_ON
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_svc.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.c | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index b7df5534da85..d33e93a7a672 100644 --- a/drivers/scsi/bfa/bfa_svc.c +++ b/drivers/scsi/bfa/bfa_svc.c | |||
@@ -309,7 +309,7 @@ bfa_plog_add(struct bfa_plog_s *plog, struct bfa_plog_rec_s *pl_rec) | |||
309 | return; | 309 | return; |
310 | 310 | ||
311 | if (plkd_validate_logrec(pl_rec)) { | 311 | if (plkd_validate_logrec(pl_rec)) { |
312 | bfa_assert(0); | 312 | WARN_ON(1); |
313 | return; | 313 | return; |
314 | } | 314 | } |
315 | 315 | ||
@@ -601,15 +601,15 @@ bfa_fcxp_init_reqrsp(struct bfa_fcxp_s *fcxp, | |||
601 | bfa_fcxp_get_sglen_t sglen_cbfn) | 601 | bfa_fcxp_get_sglen_t sglen_cbfn) |
602 | { | 602 | { |
603 | 603 | ||
604 | bfa_assert(bfa != NULL); | 604 | WARN_ON(bfa == NULL); |
605 | 605 | ||
606 | bfa_trc(bfa, fcxp->fcxp_tag); | 606 | bfa_trc(bfa, fcxp->fcxp_tag); |
607 | 607 | ||
608 | if (n_sgles == 0) { | 608 | if (n_sgles == 0) { |
609 | *use_ibuf = 1; | 609 | *use_ibuf = 1; |
610 | } else { | 610 | } else { |
611 | bfa_assert(*sga_cbfn != NULL); | 611 | WARN_ON(*sga_cbfn == NULL); |
612 | bfa_assert(*sglen_cbfn != NULL); | 612 | WARN_ON(*sglen_cbfn == NULL); |
613 | 613 | ||
614 | *use_ibuf = 0; | 614 | *use_ibuf = 0; |
615 | *r_sga_cbfn = sga_cbfn; | 615 | *r_sga_cbfn = sga_cbfn; |
@@ -621,7 +621,7 @@ bfa_fcxp_init_reqrsp(struct bfa_fcxp_s *fcxp, | |||
621 | * alloc required sgpgs | 621 | * alloc required sgpgs |
622 | */ | 622 | */ |
623 | if (n_sgles > BFI_SGE_INLINE) | 623 | if (n_sgles > BFI_SGE_INLINE) |
624 | bfa_assert(0); | 624 | WARN_ON(1); |
625 | } | 625 | } |
626 | 626 | ||
627 | } | 627 | } |
@@ -635,7 +635,7 @@ bfa_fcxp_init(struct bfa_fcxp_s *fcxp, | |||
635 | bfa_fcxp_get_sglen_t rsp_sglen_cbfn) | 635 | bfa_fcxp_get_sglen_t rsp_sglen_cbfn) |
636 | { | 636 | { |
637 | 637 | ||
638 | bfa_assert(bfa != NULL); | 638 | WARN_ON(bfa == NULL); |
639 | 639 | ||
640 | bfa_trc(bfa, fcxp->fcxp_tag); | 640 | bfa_trc(bfa, fcxp->fcxp_tag); |
641 | 641 | ||
@@ -672,7 +672,7 @@ bfa_fcxp_put(struct bfa_fcxp_s *fcxp) | |||
672 | return; | 672 | return; |
673 | } | 673 | } |
674 | 674 | ||
675 | bfa_assert(bfa_q_is_on_q(&mod->fcxp_active_q, fcxp)); | 675 | WARN_ON(!bfa_q_is_on_q(&mod->fcxp_active_q, fcxp)); |
676 | list_del(&fcxp->qe); | 676 | list_del(&fcxp->qe); |
677 | list_add_tail(&fcxp->qe, &mod->fcxp_free_q); | 677 | list_add_tail(&fcxp->qe, &mod->fcxp_free_q); |
678 | } | 678 | } |
@@ -721,7 +721,7 @@ hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp) | |||
721 | 721 | ||
722 | fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag); | 722 | fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag); |
723 | 723 | ||
724 | bfa_assert(fcxp->send_cbfn != NULL); | 724 | WARN_ON(fcxp->send_cbfn == NULL); |
725 | 725 | ||
726 | hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp); | 726 | hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp); |
727 | 727 | ||
@@ -877,13 +877,13 @@ bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req) | |||
877 | BFA_FCXP_REQ_PLD_PA(fcxp)); | 877 | BFA_FCXP_REQ_PLD_PA(fcxp)); |
878 | } else { | 878 | } else { |
879 | if (fcxp->nreq_sgles > 0) { | 879 | if (fcxp->nreq_sgles > 0) { |
880 | bfa_assert(fcxp->nreq_sgles == 1); | 880 | WARN_ON(fcxp->nreq_sgles != 1); |
881 | hal_fcxp_set_local_sges(send_req->req_sge, | 881 | hal_fcxp_set_local_sges(send_req->req_sge, |
882 | reqi->req_tot_len, | 882 | reqi->req_tot_len, |
883 | fcxp->req_sga_cbfn(fcxp->caller, | 883 | fcxp->req_sga_cbfn(fcxp->caller, |
884 | 0)); | 884 | 0)); |
885 | } else { | 885 | } else { |
886 | bfa_assert(reqi->req_tot_len == 0); | 886 | WARN_ON(reqi->req_tot_len != 0); |
887 | hal_fcxp_set_local_sges(send_req->rsp_sge, 0, 0); | 887 | hal_fcxp_set_local_sges(send_req->rsp_sge, 0, 0); |
888 | } | 888 | } |
889 | } | 889 | } |
@@ -892,20 +892,20 @@ bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req) | |||
892 | * setup rsp sgles | 892 | * setup rsp sgles |
893 | */ | 893 | */ |
894 | if (fcxp->use_irspbuf == 1) { | 894 | if (fcxp->use_irspbuf == 1) { |
895 | bfa_assert(rspi->rsp_maxlen <= BFA_FCXP_MAX_LBUF_SZ); | 895 | WARN_ON(rspi->rsp_maxlen > BFA_FCXP_MAX_LBUF_SZ); |
896 | 896 | ||
897 | hal_fcxp_set_local_sges(send_req->rsp_sge, rspi->rsp_maxlen, | 897 | hal_fcxp_set_local_sges(send_req->rsp_sge, rspi->rsp_maxlen, |
898 | BFA_FCXP_RSP_PLD_PA(fcxp)); | 898 | BFA_FCXP_RSP_PLD_PA(fcxp)); |
899 | 899 | ||
900 | } else { | 900 | } else { |
901 | if (fcxp->nrsp_sgles > 0) { | 901 | if (fcxp->nrsp_sgles > 0) { |
902 | bfa_assert(fcxp->nrsp_sgles == 1); | 902 | WARN_ON(fcxp->nrsp_sgles != 1); |
903 | hal_fcxp_set_local_sges(send_req->rsp_sge, | 903 | hal_fcxp_set_local_sges(send_req->rsp_sge, |
904 | rspi->rsp_maxlen, | 904 | rspi->rsp_maxlen, |
905 | fcxp->rsp_sga_cbfn(fcxp->caller, | 905 | fcxp->rsp_sga_cbfn(fcxp->caller, |
906 | 0)); | 906 | 0)); |
907 | } else { | 907 | } else { |
908 | bfa_assert(rspi->rsp_maxlen == 0); | 908 | WARN_ON(rspi->rsp_maxlen != 0); |
909 | hal_fcxp_set_local_sges(send_req->rsp_sge, 0, 0); | 909 | hal_fcxp_set_local_sges(send_req->rsp_sge, 0, 0); |
910 | } | 910 | } |
911 | } | 911 | } |
@@ -950,7 +950,7 @@ bfa_fcxp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles, | |||
950 | { | 950 | { |
951 | struct bfa_fcxp_s *fcxp = NULL; | 951 | struct bfa_fcxp_s *fcxp = NULL; |
952 | 952 | ||
953 | bfa_assert(bfa != NULL); | 953 | WARN_ON(bfa == NULL); |
954 | 954 | ||
955 | fcxp = bfa_fcxp_get(BFA_FCXP_MOD(bfa)); | 955 | fcxp = bfa_fcxp_get(BFA_FCXP_MOD(bfa)); |
956 | if (fcxp == NULL) | 956 | if (fcxp == NULL) |
@@ -977,7 +977,7 @@ bfa_fcxp_get_reqbuf(struct bfa_fcxp_s *fcxp) | |||
977 | struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; | 977 | struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; |
978 | void *reqbuf; | 978 | void *reqbuf; |
979 | 979 | ||
980 | bfa_assert(fcxp->use_ireqbuf == 1); | 980 | WARN_ON(fcxp->use_ireqbuf != 1); |
981 | reqbuf = ((u8 *)mod->req_pld_list_kva) + | 981 | reqbuf = ((u8 *)mod->req_pld_list_kva) + |
982 | fcxp->fcxp_tag * mod->req_pld_sz; | 982 | fcxp->fcxp_tag * mod->req_pld_sz; |
983 | return reqbuf; | 983 | return reqbuf; |
@@ -1004,7 +1004,7 @@ bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp) | |||
1004 | struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; | 1004 | struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; |
1005 | void *rspbuf; | 1005 | void *rspbuf; |
1006 | 1006 | ||
1007 | bfa_assert(fcxp->use_irspbuf == 1); | 1007 | WARN_ON(fcxp->use_irspbuf != 1); |
1008 | 1008 | ||
1009 | rspbuf = ((u8 *)mod->rsp_pld_list_kva) + | 1009 | rspbuf = ((u8 *)mod->rsp_pld_list_kva) + |
1010 | fcxp->fcxp_tag * mod->rsp_pld_sz; | 1010 | fcxp->fcxp_tag * mod->rsp_pld_sz; |
@@ -1023,7 +1023,7 @@ bfa_fcxp_free(struct bfa_fcxp_s *fcxp) | |||
1023 | { | 1023 | { |
1024 | struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; | 1024 | struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; |
1025 | 1025 | ||
1026 | bfa_assert(fcxp != NULL); | 1026 | WARN_ON(fcxp == NULL); |
1027 | bfa_trc(mod->bfa, fcxp->fcxp_tag); | 1027 | bfa_trc(mod->bfa, fcxp->fcxp_tag); |
1028 | bfa_fcxp_put(fcxp); | 1028 | bfa_fcxp_put(fcxp); |
1029 | } | 1029 | } |
@@ -1102,7 +1102,7 @@ bfa_status_t | |||
1102 | bfa_fcxp_abort(struct bfa_fcxp_s *fcxp) | 1102 | bfa_fcxp_abort(struct bfa_fcxp_s *fcxp) |
1103 | { | 1103 | { |
1104 | bfa_trc(fcxp->fcxp_mod->bfa, fcxp->fcxp_tag); | 1104 | bfa_trc(fcxp->fcxp_mod->bfa, fcxp->fcxp_tag); |
1105 | bfa_assert(0); | 1105 | WARN_ON(1); |
1106 | return BFA_STATUS_OK; | 1106 | return BFA_STATUS_OK; |
1107 | } | 1107 | } |
1108 | 1108 | ||
@@ -1117,7 +1117,7 @@ bfa_fcxp_alloc_wait(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe, | |||
1117 | { | 1117 | { |
1118 | struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); | 1118 | struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); |
1119 | 1119 | ||
1120 | bfa_assert(list_empty(&mod->fcxp_free_q)); | 1120 | WARN_ON(!list_empty(&mod->fcxp_free_q)); |
1121 | 1121 | ||
1122 | wqe->alloc_cbfn = alloc_cbfn; | 1122 | wqe->alloc_cbfn = alloc_cbfn; |
1123 | wqe->alloc_cbarg = alloc_cbarg; | 1123 | wqe->alloc_cbarg = alloc_cbarg; |
@@ -1138,7 +1138,7 @@ bfa_fcxp_walloc_cancel(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe) | |||
1138 | { | 1138 | { |
1139 | struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); | 1139 | struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); |
1140 | 1140 | ||
1141 | bfa_assert(bfa_q_is_on_q(&mod->wait_q, wqe)); | 1141 | WARN_ON(!bfa_q_is_on_q(&mod->wait_q, wqe)); |
1142 | list_del(&wqe->qe); | 1142 | list_del(&wqe->qe); |
1143 | } | 1143 | } |
1144 | 1144 | ||
@@ -1169,7 +1169,7 @@ bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg) | |||
1169 | 1169 | ||
1170 | default: | 1170 | default: |
1171 | bfa_trc(bfa, msg->mhdr.msg_id); | 1171 | bfa_trc(bfa, msg->mhdr.msg_id); |
1172 | bfa_assert(0); | 1172 | WARN_ON(1); |
1173 | } | 1173 | } |
1174 | } | 1174 | } |
1175 | 1175 | ||
@@ -1555,7 +1555,7 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp) | |||
1555 | struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); | 1555 | struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); |
1556 | struct bfa_lps_s *lps; | 1556 | struct bfa_lps_s *lps; |
1557 | 1557 | ||
1558 | bfa_assert(rsp->lp_tag < mod->num_lps); | 1558 | WARN_ON(rsp->lp_tag >= mod->num_lps); |
1559 | lps = BFA_LPS_FROM_TAG(mod, rsp->lp_tag); | 1559 | lps = BFA_LPS_FROM_TAG(mod, rsp->lp_tag); |
1560 | 1560 | ||
1561 | lps->status = rsp->status; | 1561 | lps->status = rsp->status; |
@@ -1603,7 +1603,7 @@ bfa_lps_logout_rsp(struct bfa_s *bfa, struct bfi_lps_logout_rsp_s *rsp) | |||
1603 | struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); | 1603 | struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); |
1604 | struct bfa_lps_s *lps; | 1604 | struct bfa_lps_s *lps; |
1605 | 1605 | ||
1606 | bfa_assert(rsp->lp_tag < mod->num_lps); | 1606 | WARN_ON(rsp->lp_tag >= mod->num_lps); |
1607 | lps = BFA_LPS_FROM_TAG(mod, rsp->lp_tag); | 1607 | lps = BFA_LPS_FROM_TAG(mod, rsp->lp_tag); |
1608 | 1608 | ||
1609 | bfa_sm_send_event(lps, BFA_LPS_SM_FWRSP); | 1609 | bfa_sm_send_event(lps, BFA_LPS_SM_FWRSP); |
@@ -1656,7 +1656,7 @@ bfa_lps_send_login(struct bfa_lps_s *lps) | |||
1656 | struct bfi_lps_login_req_s *m; | 1656 | struct bfi_lps_login_req_s *m; |
1657 | 1657 | ||
1658 | m = bfa_reqq_next(lps->bfa, lps->reqq); | 1658 | m = bfa_reqq_next(lps->bfa, lps->reqq); |
1659 | bfa_assert(m); | 1659 | WARN_ON(!m); |
1660 | 1660 | ||
1661 | bfi_h2i_set(m->mh, BFI_MC_LPS, BFI_LPS_H2I_LOGIN_REQ, | 1661 | bfi_h2i_set(m->mh, BFI_MC_LPS, BFI_LPS_H2I_LOGIN_REQ, |
1662 | bfa_lpuid(lps->bfa)); | 1662 | bfa_lpuid(lps->bfa)); |
@@ -1681,7 +1681,7 @@ bfa_lps_send_logout(struct bfa_lps_s *lps) | |||
1681 | struct bfi_lps_logout_req_s *m; | 1681 | struct bfi_lps_logout_req_s *m; |
1682 | 1682 | ||
1683 | m = bfa_reqq_next(lps->bfa, lps->reqq); | 1683 | m = bfa_reqq_next(lps->bfa, lps->reqq); |
1684 | bfa_assert(m); | 1684 | WARN_ON(!m); |
1685 | 1685 | ||
1686 | bfi_h2i_set(m->mh, BFI_MC_LPS, BFI_LPS_H2I_LOGOUT_REQ, | 1686 | bfi_h2i_set(m->mh, BFI_MC_LPS, BFI_LPS_H2I_LOGOUT_REQ, |
1687 | bfa_lpuid(lps->bfa)); | 1687 | bfa_lpuid(lps->bfa)); |
@@ -1700,7 +1700,7 @@ bfa_lps_send_set_n2n_pid(struct bfa_lps_s *lps) | |||
1700 | struct bfi_lps_n2n_pid_req_s *m; | 1700 | struct bfi_lps_n2n_pid_req_s *m; |
1701 | 1701 | ||
1702 | m = bfa_reqq_next(lps->bfa, lps->reqq); | 1702 | m = bfa_reqq_next(lps->bfa, lps->reqq); |
1703 | bfa_assert(m); | 1703 | WARN_ON(!m); |
1704 | 1704 | ||
1705 | bfi_h2i_set(m->mh, BFI_MC_LPS, BFI_LPS_H2I_N2N_PID_REQ, | 1705 | bfi_h2i_set(m->mh, BFI_MC_LPS, BFI_LPS_H2I_N2N_PID_REQ, |
1706 | bfa_lpuid(lps->bfa)); | 1706 | bfa_lpuid(lps->bfa)); |
@@ -1969,7 +1969,7 @@ bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *m) | |||
1969 | 1969 | ||
1970 | default: | 1970 | default: |
1971 | bfa_trc(bfa, m->mhdr.msg_id); | 1971 | bfa_trc(bfa, m->mhdr.msg_id); |
1972 | bfa_assert(0); | 1972 | WARN_ON(1); |
1973 | } | 1973 | } |
1974 | } | 1974 | } |
1975 | 1975 | ||
@@ -2099,7 +2099,7 @@ bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, | |||
2099 | bfa_fcport_update_linkinfo(fcport); | 2099 | bfa_fcport_update_linkinfo(fcport); |
2100 | bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); | 2100 | bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); |
2101 | 2101 | ||
2102 | bfa_assert(fcport->event_cbfn); | 2102 | WARN_ON(!fcport->event_cbfn); |
2103 | bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); | 2103 | bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); |
2104 | break; | 2104 | break; |
2105 | 2105 | ||
@@ -2150,7 +2150,7 @@ bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, | |||
2150 | case BFA_FCPORT_SM_LINKUP: | 2150 | case BFA_FCPORT_SM_LINKUP: |
2151 | bfa_fcport_update_linkinfo(fcport); | 2151 | bfa_fcport_update_linkinfo(fcport); |
2152 | bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); | 2152 | bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); |
2153 | bfa_assert(fcport->event_cbfn); | 2153 | WARN_ON(!fcport->event_cbfn); |
2154 | bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, | 2154 | bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, |
2155 | BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkup"); | 2155 | BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkup"); |
2156 | if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { | 2156 | if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { |
@@ -2754,7 +2754,7 @@ bfa_fcport_scn(struct bfa_fcport_s *fcport, enum bfa_port_linkstate event, | |||
2754 | bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKDOWN); | 2754 | bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKDOWN); |
2755 | break; | 2755 | break; |
2756 | default: | 2756 | default: |
2757 | bfa_assert(0); | 2757 | WARN_ON(1); |
2758 | } | 2758 | } |
2759 | } | 2759 | } |
2760 | 2760 | ||
@@ -3219,8 +3219,8 @@ bfa_trunk_scn(struct bfa_fcport_s *fcport, struct bfi_fcport_trunk_scn_s *scn) | |||
3219 | int link_bm = 0; | 3219 | int link_bm = 0; |
3220 | 3220 | ||
3221 | bfa_trc(fcport->bfa, fcport->cfg.trunked); | 3221 | bfa_trc(fcport->bfa, fcport->cfg.trunked); |
3222 | bfa_assert(scn->trunk_state == BFA_TRUNK_ONLINE || | 3222 | WARN_ON(scn->trunk_state != BFA_TRUNK_ONLINE && |
3223 | scn->trunk_state == BFA_TRUNK_OFFLINE); | 3223 | scn->trunk_state != BFA_TRUNK_OFFLINE); |
3224 | 3224 | ||
3225 | bfa_trc(fcport->bfa, trunk->attr.state); | 3225 | bfa_trc(fcport->bfa, trunk->attr.state); |
3226 | bfa_trc(fcport->bfa, scn->trunk_state); | 3226 | bfa_trc(fcport->bfa, scn->trunk_state); |
@@ -3329,9 +3329,9 @@ bfa_fcport_init(struct bfa_s *bfa) | |||
3329 | fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); | 3329 | fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); |
3330 | fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); | 3330 | fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); |
3331 | 3331 | ||
3332 | bfa_assert(fcport->cfg.maxfrsize); | 3332 | WARN_ON(!fcport->cfg.maxfrsize); |
3333 | bfa_assert(fcport->cfg.rx_bbcredit); | 3333 | WARN_ON(!fcport->cfg.rx_bbcredit); |
3334 | bfa_assert(fcport->speed_sup); | 3334 | WARN_ON(!fcport->speed_sup); |
3335 | } | 3335 | } |
3336 | 3336 | ||
3337 | /* | 3337 | /* |
@@ -3428,7 +3428,7 @@ bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg) | |||
3428 | break; | 3428 | break; |
3429 | 3429 | ||
3430 | default: | 3430 | default: |
3431 | bfa_assert(0); | 3431 | WARN_ON(1); |
3432 | break; | 3432 | break; |
3433 | } | 3433 | } |
3434 | } | 3434 | } |
@@ -4310,8 +4310,8 @@ bfa_rport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
4310 | mod->rps_list = rp; | 4310 | mod->rps_list = rp; |
4311 | mod->num_rports = cfg->fwcfg.num_rports; | 4311 | mod->num_rports = cfg->fwcfg.num_rports; |
4312 | 4312 | ||
4313 | bfa_assert(mod->num_rports && | 4313 | WARN_ON(!mod->num_rports || |
4314 | !(mod->num_rports & (mod->num_rports - 1))); | 4314 | (mod->num_rports & (mod->num_rports - 1))); |
4315 | 4315 | ||
4316 | for (i = 0; i < mod->num_rports; i++, rp++) { | 4316 | for (i = 0; i < mod->num_rports; i++, rp++) { |
4317 | memset(rp, 0, sizeof(struct bfa_rport_s)); | 4317 | memset(rp, 0, sizeof(struct bfa_rport_s)); |
@@ -4379,7 +4379,7 @@ bfa_rport_free(struct bfa_rport_s *rport) | |||
4379 | { | 4379 | { |
4380 | struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa); | 4380 | struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa); |
4381 | 4381 | ||
4382 | bfa_assert(bfa_q_is_on_q(&mod->rp_active_q, rport)); | 4382 | WARN_ON(!bfa_q_is_on_q(&mod->rp_active_q, rport)); |
4383 | list_del(&rport->qe); | 4383 | list_del(&rport->qe); |
4384 | list_add_tail(&rport->qe, &mod->rp_free_q); | 4384 | list_add_tail(&rport->qe, &mod->rp_free_q); |
4385 | } | 4385 | } |
@@ -4492,13 +4492,13 @@ bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *m) | |||
4492 | rp = BFA_RPORT_FROM_TAG(bfa, msg.create_rsp->bfa_handle); | 4492 | rp = BFA_RPORT_FROM_TAG(bfa, msg.create_rsp->bfa_handle); |
4493 | rp->fw_handle = msg.create_rsp->fw_handle; | 4493 | rp->fw_handle = msg.create_rsp->fw_handle; |
4494 | rp->qos_attr = msg.create_rsp->qos_attr; | 4494 | rp->qos_attr = msg.create_rsp->qos_attr; |
4495 | bfa_assert(msg.create_rsp->status == BFA_STATUS_OK); | 4495 | WARN_ON(msg.create_rsp->status != BFA_STATUS_OK); |
4496 | bfa_sm_send_event(rp, BFA_RPORT_SM_FWRSP); | 4496 | bfa_sm_send_event(rp, BFA_RPORT_SM_FWRSP); |
4497 | break; | 4497 | break; |
4498 | 4498 | ||
4499 | case BFI_RPORT_I2H_DELETE_RSP: | 4499 | case BFI_RPORT_I2H_DELETE_RSP: |
4500 | rp = BFA_RPORT_FROM_TAG(bfa, msg.delete_rsp->bfa_handle); | 4500 | rp = BFA_RPORT_FROM_TAG(bfa, msg.delete_rsp->bfa_handle); |
4501 | bfa_assert(msg.delete_rsp->status == BFA_STATUS_OK); | 4501 | WARN_ON(msg.delete_rsp->status != BFA_STATUS_OK); |
4502 | bfa_sm_send_event(rp, BFA_RPORT_SM_FWRSP); | 4502 | bfa_sm_send_event(rp, BFA_RPORT_SM_FWRSP); |
4503 | break; | 4503 | break; |
4504 | 4504 | ||
@@ -4510,7 +4510,7 @@ bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *m) | |||
4510 | 4510 | ||
4511 | default: | 4511 | default: |
4512 | bfa_trc(bfa, m->mhdr.msg_id); | 4512 | bfa_trc(bfa, m->mhdr.msg_id); |
4513 | bfa_assert(0); | 4513 | WARN_ON(1); |
4514 | } | 4514 | } |
4515 | } | 4515 | } |
4516 | 4516 | ||
@@ -4534,7 +4534,7 @@ bfa_rport_create(struct bfa_s *bfa, void *rport_drv) | |||
4534 | rp->rport_drv = rport_drv; | 4534 | rp->rport_drv = rport_drv; |
4535 | memset(&rp->stats, 0, sizeof(rp->stats)); | 4535 | memset(&rp->stats, 0, sizeof(rp->stats)); |
4536 | 4536 | ||
4537 | bfa_assert(bfa_sm_cmp_state(rp, bfa_rport_sm_uninit)); | 4537 | WARN_ON(!bfa_sm_cmp_state(rp, bfa_rport_sm_uninit)); |
4538 | bfa_sm_send_event(rp, BFA_RPORT_SM_CREATE); | 4538 | bfa_sm_send_event(rp, BFA_RPORT_SM_CREATE); |
4539 | 4539 | ||
4540 | return rp; | 4540 | return rp; |
@@ -4543,7 +4543,7 @@ bfa_rport_create(struct bfa_s *bfa, void *rport_drv) | |||
4543 | void | 4543 | void |
4544 | bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info) | 4544 | bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info) |
4545 | { | 4545 | { |
4546 | bfa_assert(rport_info->max_frmsz != 0); | 4546 | WARN_ON(rport_info->max_frmsz == 0); |
4547 | 4547 | ||
4548 | /* | 4548 | /* |
4549 | * Some JBODs are seen to be not setting PDU size correctly in PLOGI | 4549 | * Some JBODs are seen to be not setting PDU size correctly in PLOGI |
@@ -4561,8 +4561,8 @@ bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info) | |||
4561 | void | 4561 | void |
4562 | bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed) | 4562 | bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed) |
4563 | { | 4563 | { |
4564 | bfa_assert(speed != 0); | 4564 | WARN_ON(speed == 0); |
4565 | bfa_assert(speed != BFA_PORT_SPEED_AUTO); | 4565 | WARN_ON(speed == BFA_PORT_SPEED_AUTO); |
4566 | 4566 | ||
4567 | rport->rport_info.speed = speed; | 4567 | rport->rport_info.speed = speed; |
4568 | bfa_sm_send_event(rport, BFA_RPORT_SM_SET_SPEED); | 4568 | bfa_sm_send_event(rport, BFA_RPORT_SM_SET_SPEED); |
@@ -4622,7 +4622,7 @@ bfa_sgpg_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
4622 | sgpg_pa.pa = mod->sgpg_arr_pa; | 4622 | sgpg_pa.pa = mod->sgpg_arr_pa; |
4623 | mod->free_sgpgs = mod->num_sgpgs; | 4623 | mod->free_sgpgs = mod->num_sgpgs; |
4624 | 4624 | ||
4625 | bfa_assert(!(sgpg_pa.pa & (sizeof(struct bfi_sgpg_s) - 1))); | 4625 | WARN_ON(sgpg_pa.pa & (sizeof(struct bfi_sgpg_s) - 1)); |
4626 | 4626 | ||
4627 | for (i = 0; i < mod->num_sgpgs; i++) { | 4627 | for (i = 0; i < mod->num_sgpgs; i++) { |
4628 | memset(hsgpg, 0, sizeof(*hsgpg)); | 4628 | memset(hsgpg, 0, sizeof(*hsgpg)); |
@@ -4677,7 +4677,7 @@ bfa_sgpg_malloc(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpgs) | |||
4677 | 4677 | ||
4678 | for (i = 0; i < nsgpgs; i++) { | 4678 | for (i = 0; i < nsgpgs; i++) { |
4679 | bfa_q_deq(&mod->sgpg_q, &hsgpg); | 4679 | bfa_q_deq(&mod->sgpg_q, &hsgpg); |
4680 | bfa_assert(hsgpg); | 4680 | WARN_ON(!hsgpg); |
4681 | list_add_tail(&hsgpg->qe, sgpg_q); | 4681 | list_add_tail(&hsgpg->qe, sgpg_q); |
4682 | } | 4682 | } |
4683 | 4683 | ||
@@ -4694,7 +4694,7 @@ bfa_sgpg_mfree(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpg) | |||
4694 | bfa_trc_fp(bfa, nsgpg); | 4694 | bfa_trc_fp(bfa, nsgpg); |
4695 | 4695 | ||
4696 | mod->free_sgpgs += nsgpg; | 4696 | mod->free_sgpgs += nsgpg; |
4697 | bfa_assert(mod->free_sgpgs <= mod->num_sgpgs); | 4697 | WARN_ON(mod->free_sgpgs > mod->num_sgpgs); |
4698 | 4698 | ||
4699 | list_splice_tail_init(sgpg_q, &mod->sgpg_q); | 4699 | list_splice_tail_init(sgpg_q, &mod->sgpg_q); |
4700 | 4700 | ||
@@ -4724,8 +4724,8 @@ bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpg) | |||
4724 | { | 4724 | { |
4725 | struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); | 4725 | struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); |
4726 | 4726 | ||
4727 | bfa_assert(nsgpg > 0); | 4727 | WARN_ON(nsgpg <= 0); |
4728 | bfa_assert(nsgpg > mod->free_sgpgs); | 4728 | WARN_ON(nsgpg <= mod->free_sgpgs); |
4729 | 4729 | ||
4730 | wqe->nsgpg_total = wqe->nsgpg = nsgpg; | 4730 | wqe->nsgpg_total = wqe->nsgpg = nsgpg; |
4731 | 4731 | ||
@@ -4736,7 +4736,7 @@ bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpg) | |||
4736 | /* | 4736 | /* |
4737 | * no one else is waiting for SGPG | 4737 | * no one else is waiting for SGPG |
4738 | */ | 4738 | */ |
4739 | bfa_assert(list_empty(&mod->sgpg_wait_q)); | 4739 | WARN_ON(!list_empty(&mod->sgpg_wait_q)); |
4740 | list_splice_tail_init(&mod->sgpg_q, &wqe->sgpg_q); | 4740 | list_splice_tail_init(&mod->sgpg_q, &wqe->sgpg_q); |
4741 | wqe->nsgpg -= mod->free_sgpgs; | 4741 | wqe->nsgpg -= mod->free_sgpgs; |
4742 | mod->free_sgpgs = 0; | 4742 | mod->free_sgpgs = 0; |
@@ -4750,7 +4750,7 @@ bfa_sgpg_wcancel(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe) | |||
4750 | { | 4750 | { |
4751 | struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); | 4751 | struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); |
4752 | 4752 | ||
4753 | bfa_assert(bfa_q_is_on_q(&mod->sgpg_wait_q, wqe)); | 4753 | WARN_ON(!bfa_q_is_on_q(&mod->sgpg_wait_q, wqe)); |
4754 | list_del(&wqe->qe); | 4754 | list_del(&wqe->qe); |
4755 | 4755 | ||
4756 | if (wqe->nsgpg_total != wqe->nsgpg) | 4756 | if (wqe->nsgpg_total != wqe->nsgpg) |
@@ -4982,7 +4982,7 @@ uf_recv(struct bfa_s *bfa, struct bfi_uf_frm_rcvd_s *m) | |||
4982 | uf->data_ptr = buf; | 4982 | uf->data_ptr = buf; |
4983 | uf->data_len = m->xfr_len; | 4983 | uf->data_len = m->xfr_len; |
4984 | 4984 | ||
4985 | bfa_assert(uf->data_len >= sizeof(struct fchs_s)); | 4985 | WARN_ON(uf->data_len < sizeof(struct fchs_s)); |
4986 | 4986 | ||
4987 | if (uf->data_len == sizeof(struct fchs_s)) { | 4987 | if (uf->data_len == sizeof(struct fchs_s)) { |
4988 | bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_UF, BFA_PL_EID_RX, | 4988 | bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_UF, BFA_PL_EID_RX, |
@@ -5072,7 +5072,7 @@ bfa_uf_isr(struct bfa_s *bfa, struct bfi_msg_s *msg) | |||
5072 | 5072 | ||
5073 | default: | 5073 | default: |
5074 | bfa_trc(bfa, msg->mhdr.msg_id); | 5074 | bfa_trc(bfa, msg->mhdr.msg_id); |
5075 | bfa_assert(0); | 5075 | WARN_ON(1); |
5076 | } | 5076 | } |
5077 | } | 5077 | } |
5078 | 5078 | ||