Commit d4b671c5 authored by Jing Huang's avatar Jing Huang Committed by James Bottomley

[SCSI] bfa: replace bfa_assert with WARN_ON

Signed-off-by: default avatarJing Huang <huangj@brocade.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent aa5cbf8a
...@@ -120,8 +120,8 @@ bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg), ...@@ -120,8 +120,8 @@ bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
\ \
struct list_head *waitq = bfa_reqq(__bfa, __reqq); \ struct list_head *waitq = bfa_reqq(__bfa, __reqq); \
\ \
bfa_assert(((__reqq) < BFI_IOC_MAX_CQS)); \ WARN_ON(((__reqq) >= BFI_IOC_MAX_CQS)); \
bfa_assert((__wqe)->qresume && (__wqe)->cbarg); \ WARN_ON(!((__wqe)->qresume && (__wqe)->cbarg)); \
\ \
list_add_tail(&(__wqe)->qe, waitq); \ list_add_tail(&(__wqe)->qe, waitq); \
} while (0) } while (0)
......
...@@ -285,7 +285,7 @@ bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -285,7 +285,7 @@ bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m)
bfa_trc(bfa, m->mhdr.msg_class); bfa_trc(bfa, m->mhdr.msg_class);
bfa_trc(bfa, m->mhdr.msg_id); bfa_trc(bfa, m->mhdr.msg_id);
bfa_trc(bfa, m->mhdr.mtag.i2htok); bfa_trc(bfa, m->mhdr.mtag.i2htok);
bfa_assert(0); WARN_ON(1);
bfa_trc_stop(bfa->trcmod); bfa_trc_stop(bfa->trcmod);
} }
...@@ -433,7 +433,7 @@ bfa_iocfc_send_cfg(void *bfa_arg) ...@@ -433,7 +433,7 @@ bfa_iocfc_send_cfg(void *bfa_arg)
struct bfa_iocfc_cfg_s *cfg = &iocfc->cfg; struct bfa_iocfc_cfg_s *cfg = &iocfc->cfg;
int i; int i;
bfa_assert(cfg->fwcfg.num_cqs <= BFI_IOC_MAX_CQS); WARN_ON(cfg->fwcfg.num_cqs > BFI_IOC_MAX_CQS);
bfa_trc(bfa, cfg->fwcfg.num_cqs); bfa_trc(bfa, cfg->fwcfg.num_cqs);
bfa_iocfc_reset_queues(bfa); bfa_iocfc_reset_queues(bfa);
...@@ -753,7 +753,7 @@ bfa_iocfc_disable_cbfn(void *bfa_arg) ...@@ -753,7 +753,7 @@ bfa_iocfc_disable_cbfn(void *bfa_arg)
bfa_cb_queue(bfa, &bfa->iocfc.stop_hcb_qe, bfa_iocfc_stop_cb, bfa_cb_queue(bfa, &bfa->iocfc.stop_hcb_qe, bfa_iocfc_stop_cb,
bfa); bfa);
else { else {
bfa_assert(bfa->iocfc.action == BFA_IOCFC_ACT_DISABLE); WARN_ON(bfa->iocfc.action != BFA_IOCFC_ACT_DISABLE);
bfa_cb_queue(bfa, &bfa->iocfc.dis_hcb_qe, bfa_iocfc_disable_cb, bfa_cb_queue(bfa, &bfa->iocfc.dis_hcb_qe, bfa_iocfc_disable_cb,
bfa); bfa);
} }
...@@ -894,7 +894,7 @@ bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m) ...@@ -894,7 +894,7 @@ bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m)
iocfc->updateq_cbfn(iocfc->updateq_cbarg, BFA_STATUS_OK); iocfc->updateq_cbfn(iocfc->updateq_cbarg, BFA_STATUS_OK);
break; break;
default: default:
bfa_assert(0); WARN_ON(1);
} }
} }
...@@ -1063,7 +1063,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo) ...@@ -1063,7 +1063,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo)
int i; int i;
u32 km_len = 0, dm_len = 0; u32 km_len = 0, dm_len = 0;
bfa_assert((cfg != NULL) && (meminfo != NULL)); WARN_ON((cfg == NULL) || (meminfo == NULL));
memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s)); memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s));
meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_type = meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_type =
...@@ -1117,7 +1117,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, ...@@ -1117,7 +1117,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa->fcs = BFA_FALSE; bfa->fcs = BFA_FALSE;
bfa_assert((cfg != NULL) && (meminfo != NULL)); WARN_ON((cfg == NULL) || (meminfo == NULL));
/* /*
* initialize all memory pointers for iterative allocation * initialize all memory pointers for iterative allocation
......
...@@ -163,16 +163,6 @@ __bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data) ...@@ -163,16 +163,6 @@ __bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data)
#define bfa_trc_fp(_trcp, _data) #define bfa_trc_fp(_trcp, _data)
#endif #endif
/*
* @ BFA LOG interfaces
*/
#define bfa_assert(__cond) do { \
if (!(__cond)) { \
printk(KERN_ERR "assert(%s) failed at %s:%d\\n", \
#__cond, __FILE__, __LINE__); \
} \
} while (0)
#define bfa_sm_fault(__mod, __event) do { \ #define bfa_sm_fault(__mod, __event) do { \
bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \ bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \
printk(KERN_ERR "Assertion failure: %s:%d: %d", \ printk(KERN_ERR "Assertion failure: %s:%d: %d", \
......
...@@ -32,12 +32,12 @@ static void bfa_itnim_update_del_itn_stats(struct bfa_itnim_s *itnim); ...@@ -32,12 +32,12 @@ static void bfa_itnim_update_del_itn_stats(struct bfa_itnim_s *itnim);
#define bfa_fcpim_additn(__itnim) \ #define bfa_fcpim_additn(__itnim) \
list_add_tail(&(__itnim)->qe, &(__itnim)->fcpim->itnim_q) list_add_tail(&(__itnim)->qe, &(__itnim)->fcpim->itnim_q)
#define bfa_fcpim_delitn(__itnim) do { \ #define bfa_fcpim_delitn(__itnim) do { \
bfa_assert(bfa_q_is_on_q(&(__itnim)->fcpim->itnim_q, __itnim)); \ WARN_ON(!bfa_q_is_on_q(&(__itnim)->fcpim->itnim_q, __itnim)); \
bfa_itnim_update_del_itn_stats(__itnim); \ bfa_itnim_update_del_itn_stats(__itnim); \
list_del(&(__itnim)->qe); \ list_del(&(__itnim)->qe); \
bfa_assert(list_empty(&(__itnim)->io_q)); \ WARN_ON(!list_empty(&(__itnim)->io_q)); \
bfa_assert(list_empty(&(__itnim)->io_cleanup_q)); \ WARN_ON(!list_empty(&(__itnim)->io_cleanup_q)); \
bfa_assert(list_empty(&(__itnim)->pending_q)); \ WARN_ON(!list_empty(&(__itnim)->pending_q)); \
} while (0) } while (0)
#define bfa_itnim_online_cb(__itnim) do { \ #define bfa_itnim_online_cb(__itnim) do { \
...@@ -1184,7 +1184,7 @@ bfa_itnim_iotov_start(struct bfa_itnim_s *itnim) ...@@ -1184,7 +1184,7 @@ bfa_itnim_iotov_start(struct bfa_itnim_s *itnim)
if (itnim->fcpim->path_tov > 0) { if (itnim->fcpim->path_tov > 0) {
itnim->iotov_active = BFA_TRUE; itnim->iotov_active = BFA_TRUE;
bfa_assert(bfa_itnim_hold_io(itnim)); WARN_ON(!bfa_itnim_hold_io(itnim));
bfa_timer_start(itnim->bfa, &itnim->timer, bfa_timer_start(itnim->bfa, &itnim->timer,
bfa_itnim_iotov, itnim, itnim->fcpim->path_tov); bfa_itnim_iotov, itnim, itnim->fcpim->path_tov);
} }
...@@ -1262,7 +1262,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -1262,7 +1262,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
case BFI_ITNIM_I2H_CREATE_RSP: case BFI_ITNIM_I2H_CREATE_RSP:
itnim = BFA_ITNIM_FROM_TAG(fcpim, itnim = BFA_ITNIM_FROM_TAG(fcpim,
msg.create_rsp->bfa_handle); msg.create_rsp->bfa_handle);
bfa_assert(msg.create_rsp->status == BFA_STATUS_OK); WARN_ON(msg.create_rsp->status != BFA_STATUS_OK);
bfa_stats(itnim, create_comps); bfa_stats(itnim, create_comps);
bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP); bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP);
break; break;
...@@ -1270,7 +1270,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -1270,7 +1270,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
case BFI_ITNIM_I2H_DELETE_RSP: case BFI_ITNIM_I2H_DELETE_RSP:
itnim = BFA_ITNIM_FROM_TAG(fcpim, itnim = BFA_ITNIM_FROM_TAG(fcpim,
msg.delete_rsp->bfa_handle); msg.delete_rsp->bfa_handle);
bfa_assert(msg.delete_rsp->status == BFA_STATUS_OK); WARN_ON(msg.delete_rsp->status != BFA_STATUS_OK);
bfa_stats(itnim, delete_comps); bfa_stats(itnim, delete_comps);
bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP); bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP);
break; break;
...@@ -1284,7 +1284,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -1284,7 +1284,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
default: default:
bfa_trc(bfa, m->mhdr.msg_id); bfa_trc(bfa, m->mhdr.msg_id);
bfa_assert(0); WARN_ON(1);
} }
} }
...@@ -1299,7 +1299,7 @@ bfa_itnim_create(struct bfa_s *bfa, struct bfa_rport_s *rport, void *ditn) ...@@ -1299,7 +1299,7 @@ bfa_itnim_create(struct bfa_s *bfa, struct bfa_rport_s *rport, void *ditn)
struct bfa_itnim_s *itnim; struct bfa_itnim_s *itnim;
itnim = BFA_ITNIM_FROM_TAG(fcpim, rport->rport_tag); itnim = BFA_ITNIM_FROM_TAG(fcpim, rport->rport_tag);
bfa_assert(itnim->rport == rport); WARN_ON(itnim->rport != rport);
itnim->ditn = ditn; itnim->ditn = ditn;
...@@ -1416,7 +1416,7 @@ bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) ...@@ -1416,7 +1416,7 @@ bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
* requests immediately. * requests immediately.
*/ */
bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); bfa_sm_set_state(ioim, bfa_ioim_sm_hcb);
bfa_assert(bfa_q_is_on_q(&ioim->itnim->pending_q, ioim)); WARN_ON(!bfa_q_is_on_q(&ioim->itnim->pending_q, ioim));
bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, bfa_cb_queue(ioim->bfa, &ioim->hcb_qe,
__bfa_cb_ioim_abort, ioim); __bfa_cb_ioim_abort, ioim);
break; break;
...@@ -1649,7 +1649,7 @@ bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) ...@@ -1649,7 +1649,7 @@ bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
break; break;
case BFA_IOIM_SM_CLEANUP: case BFA_IOIM_SM_CLEANUP:
bfa_assert(ioim->iosp->abort_explicit == BFA_TRUE); WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE);
ioim->iosp->abort_explicit = BFA_FALSE; ioim->iosp->abort_explicit = BFA_FALSE;
if (bfa_ioim_send_abort(ioim)) if (bfa_ioim_send_abort(ioim))
...@@ -1795,7 +1795,7 @@ bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) ...@@ -1795,7 +1795,7 @@ bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
break; break;
case BFA_IOIM_SM_CLEANUP: case BFA_IOIM_SM_CLEANUP:
bfa_assert(ioim->iosp->abort_explicit == BFA_TRUE); WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE);
ioim->iosp->abort_explicit = BFA_FALSE; ioim->iosp->abort_explicit = BFA_FALSE;
bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull);
break; break;
...@@ -2236,7 +2236,7 @@ bfa_ioim_sgpg_alloc(struct bfa_ioim_s *ioim) ...@@ -2236,7 +2236,7 @@ bfa_ioim_sgpg_alloc(struct bfa_ioim_s *ioim)
{ {
u16 nsgpgs; u16 nsgpgs;
bfa_assert(ioim->nsges > BFI_SGE_INLINE); WARN_ON(ioim->nsges <= BFI_SGE_INLINE);
/* /*
* allocate SG pages needed * allocate SG pages needed
...@@ -2444,7 +2444,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -2444,7 +2444,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
iotag = be16_to_cpu(rsp->io_tag); iotag = be16_to_cpu(rsp->io_tag);
ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); ioim = BFA_IOIM_FROM_TAG(fcpim, iotag);
bfa_assert(ioim->iotag == iotag); WARN_ON(ioim->iotag != iotag);
bfa_trc(ioim->bfa, ioim->iotag); bfa_trc(ioim->bfa, ioim->iotag);
bfa_trc(ioim->bfa, rsp->io_status); bfa_trc(ioim->bfa, rsp->io_status);
...@@ -2475,13 +2475,13 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -2475,13 +2475,13 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
case BFI_IOIM_STS_PROTO_ERR: case BFI_IOIM_STS_PROTO_ERR:
bfa_stats(ioim->itnim, iocom_proto_err); bfa_stats(ioim->itnim, iocom_proto_err);
bfa_assert(rsp->reuse_io_tag); WARN_ON(!rsp->reuse_io_tag);
evt = BFA_IOIM_SM_COMP; evt = BFA_IOIM_SM_COMP;
break; break;
case BFI_IOIM_STS_SQER_NEEDED: case BFI_IOIM_STS_SQER_NEEDED:
bfa_stats(ioim->itnim, iocom_sqer_needed); bfa_stats(ioim->itnim, iocom_sqer_needed);
bfa_assert(rsp->reuse_io_tag == 0); WARN_ON(rsp->reuse_io_tag != 0);
evt = BFA_IOIM_SM_SQRETRY; evt = BFA_IOIM_SM_SQRETRY;
break; break;
...@@ -2510,7 +2510,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -2510,7 +2510,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
break; break;
default: default:
bfa_assert(0); WARN_ON(1);
} }
bfa_sm_send_event(ioim, evt); bfa_sm_send_event(ioim, evt);
...@@ -2527,7 +2527,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -2527,7 +2527,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
iotag = be16_to_cpu(rsp->io_tag); iotag = be16_to_cpu(rsp->io_tag);
ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); ioim = BFA_IOIM_FROM_TAG(fcpim, iotag);
bfa_assert(BFA_IOIM_TAG_2_ID(ioim->iotag) == iotag); WARN_ON(BFA_IOIM_TAG_2_ID(ioim->iotag) != iotag);
bfa_trc_fp(ioim->bfa, ioim->iotag); bfa_trc_fp(ioim->bfa, ioim->iotag);
bfa_ioim_cb_profile_comp(fcpim, ioim); bfa_ioim_cb_profile_comp(fcpim, ioim);
...@@ -2944,7 +2944,7 @@ bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun) ...@@ -2944,7 +2944,7 @@ bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun)
return !memcmp(&tskim->lun, &lun, sizeof(lun)); return !memcmp(&tskim->lun, &lun, sizeof(lun));
default: default:
bfa_assert(0); WARN_ON(1);
} }
return BFA_FALSE; return BFA_FALSE;
...@@ -3190,7 +3190,7 @@ bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -3190,7 +3190,7 @@ bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
u16 tsk_tag = be16_to_cpu(rsp->tsk_tag); u16 tsk_tag = be16_to_cpu(rsp->tsk_tag);
tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag); tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag);
bfa_assert(tskim->tsk_tag == tsk_tag); WARN_ON(tskim->tsk_tag != tsk_tag);
tskim->tsk_status = rsp->tsk_status; tskim->tsk_status = rsp->tsk_status;
...@@ -3225,7 +3225,7 @@ bfa_tskim_alloc(struct bfa_s *bfa, struct bfad_tskim_s *dtsk) ...@@ -3225,7 +3225,7 @@ bfa_tskim_alloc(struct bfa_s *bfa, struct bfad_tskim_s *dtsk)
void void
bfa_tskim_free(struct bfa_tskim_s *tskim) bfa_tskim_free(struct bfa_tskim_s *tskim)
{ {
bfa_assert(bfa_q_is_on_q_func(&tskim->itnim->tsk_q, &tskim->qe)); WARN_ON(!bfa_q_is_on_q_func(&tskim->itnim->tsk_q, &tskim->qe));
list_del(&tskim->qe); list_del(&tskim->qe);
list_add_tail(&tskim->qe, &tskim->fcpim->tskim_free_q); list_add_tail(&tskim->qe, &tskim->fcpim->tskim_free_q);
} }
......
...@@ -920,7 +920,7 @@ bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs) ...@@ -920,7 +920,7 @@ bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
INIT_LIST_HEAD(&fabric->vport_q); INIT_LIST_HEAD(&fabric->vport_q);
INIT_LIST_HEAD(&fabric->vf_q); INIT_LIST_HEAD(&fabric->vf_q);
fabric->lps = bfa_lps_alloc(fcs->bfa); fabric->lps = bfa_lps_alloc(fcs->bfa);
bfa_assert(fabric->lps); WARN_ON(!fabric->lps);
/* /*
* Initialize fabric delete completion handler. Fabric deletion is * Initialize fabric delete completion handler. Fabric deletion is
...@@ -1317,7 +1317,7 @@ bfa_fcs_port_event_handler(void *cbarg, enum bfa_port_linkstate event) ...@@ -1317,7 +1317,7 @@ bfa_fcs_port_event_handler(void *cbarg, enum bfa_port_linkstate event)
break; break;
default: default:
bfa_assert(0); WARN_ON(1);
} }
} }
...@@ -1364,7 +1364,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf) ...@@ -1364,7 +1364,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
* drop frame if vfid is unknown * drop frame if vfid is unknown
*/ */
if (!fabric) { if (!fabric) {
bfa_assert(0); WARN_ON(1);
bfa_stats(fcs, uf.vfid_unknown); bfa_stats(fcs, uf.vfid_unknown);
bfa_uf_free(uf); bfa_uf_free(uf);
return; return;
......
...@@ -536,7 +536,7 @@ bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport) ...@@ -536,7 +536,7 @@ bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport)
if (bfa_itnim == NULL) { if (bfa_itnim == NULL) {
bfa_trc(port->fcs, rport->pwwn); bfa_trc(port->fcs, rport->pwwn);
bfa_fcb_itnim_free(port->fcs->bfad, itnim_drv); bfa_fcb_itnim_free(port->fcs->bfad, itnim_drv);
bfa_assert(0); WARN_ON(1);
return NULL; return NULL;
} }
...@@ -700,7 +700,7 @@ bfa_fcs_itnim_lookup(struct bfa_fcs_lport_s *port, wwn_t rpwwn) ...@@ -700,7 +700,7 @@ bfa_fcs_itnim_lookup(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
if (!rport) if (!rport)
return NULL; return NULL;
bfa_assert(rport->itnim != NULL); WARN_ON(rport->itnim == NULL);
return rport->itnim; return rport->itnim;
} }
...@@ -729,7 +729,7 @@ bfa_fcs_itnim_stats_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn, ...@@ -729,7 +729,7 @@ bfa_fcs_itnim_stats_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
{ {
struct bfa_fcs_itnim_s *itnim = NULL; struct bfa_fcs_itnim_s *itnim = NULL;
bfa_assert(port != NULL); WARN_ON(port == NULL);
itnim = bfa_fcs_itnim_lookup(port, rpwwn); itnim = bfa_fcs_itnim_lookup(port, rpwwn);
...@@ -746,7 +746,7 @@ bfa_fcs_itnim_stats_clear(struct bfa_fcs_lport_s *port, wwn_t rpwwn) ...@@ -746,7 +746,7 @@ bfa_fcs_itnim_stats_clear(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
{ {
struct bfa_fcs_itnim_s *itnim = NULL; struct bfa_fcs_itnim_s *itnim = NULL;
bfa_assert(port != NULL); WARN_ON(port == NULL);
itnim = bfa_fcs_itnim_lookup(port, rpwwn); itnim = bfa_fcs_itnim_lookup(port, rpwwn);
...@@ -778,6 +778,6 @@ bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim, ...@@ -778,6 +778,6 @@ bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim,
break; break;
default: default:
bfa_assert(0); WARN_ON(1);
} }
} }
...@@ -351,7 +351,7 @@ bfa_fcs_lport_plogi(struct bfa_fcs_lport_s *port, ...@@ -351,7 +351,7 @@ bfa_fcs_lport_plogi(struct bfa_fcs_lport_s *port,
* This is a different device with the same pid. Old device * This is a different device with the same pid. Old device
* disappeared. Send implicit LOGO to old device. * disappeared. Send implicit LOGO to old device.
*/ */
bfa_assert(rport->pwwn != plogi->port_name); WARN_ON(rport->pwwn == plogi->port_name);
bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP);
/* /*
...@@ -364,7 +364,7 @@ bfa_fcs_lport_plogi(struct bfa_fcs_lport_s *port, ...@@ -364,7 +364,7 @@ bfa_fcs_lport_plogi(struct bfa_fcs_lport_s *port,
/* /*
* PLOGI crossing each other. * PLOGI crossing each other.
*/ */
bfa_assert(rport->pwwn == WWN_NULL); WARN_ON(rport->pwwn != WWN_NULL);
bfa_fcs_rport_plogi(rport, rx_fchs, plogi); bfa_fcs_rport_plogi(rport, rx_fchs, plogi);
} }
...@@ -532,19 +532,19 @@ bfa_fcs_lport_offline_actions(struct bfa_fcs_lport_s *port) ...@@ -532,19 +532,19 @@ bfa_fcs_lport_offline_actions(struct bfa_fcs_lport_s *port)
static void static void
bfa_fcs_lport_unknown_init(struct bfa_fcs_lport_s *port) bfa_fcs_lport_unknown_init(struct bfa_fcs_lport_s *port)
{ {
bfa_assert(0); WARN_ON(1);
} }
static void static void
bfa_fcs_lport_unknown_online(struct bfa_fcs_lport_s *port) bfa_fcs_lport_unknown_online(struct bfa_fcs_lport_s *port)
{ {
bfa_assert(0); WARN_ON(1);
} }
static void static void
bfa_fcs_lport_unknown_offline(struct bfa_fcs_lport_s *port) bfa_fcs_lport_unknown_offline(struct bfa_fcs_lport_s *port)
{ {
bfa_assert(0); WARN_ON(1);
} }
static void static void
...@@ -777,7 +777,7 @@ bfa_fcs_lport_del_rport( ...@@ -777,7 +777,7 @@ bfa_fcs_lport_del_rport(
struct bfa_fcs_lport_s *port, struct bfa_fcs_lport_s *port,
struct bfa_fcs_rport_s *rport) struct bfa_fcs_rport_s *rport)
{ {
bfa_assert(bfa_q_is_on_q(&port->rport_q, rport)); WARN_ON(!bfa_q_is_on_q(&port->rport_q, rport));
list_del(&rport->qe); list_del(&rport->qe);
port->num_rports--; port->num_rports--;
...@@ -1005,7 +1005,7 @@ bfa_fcs_lport_n2n_online(struct bfa_fcs_lport_s *port) ...@@ -1005,7 +1005,7 @@ bfa_fcs_lport_n2n_online(struct bfa_fcs_lport_s *port)
*/ */
if (port->num_rports > 0) { if (port->num_rports > 0) {
rport = bfa_fcs_lport_get_rport_by_pid(port, 0); rport = bfa_fcs_lport_get_rport_by_pid(port, 0);
bfa_assert(rport != NULL); WARN_ON(rport == NULL);
if (rport) { if (rport) {
bfa_trc(port->fcs, rport->pwwn); bfa_trc(port->fcs, rport->pwwn);
bfa_sm_send_event(rport, RPSM_EVENT_DELETE); bfa_sm_send_event(rport, RPSM_EVENT_DELETE);
...@@ -4153,7 +4153,7 @@ bfa_fcs_lport_ns_boot_target_disc(bfa_fcs_lport_t *port) ...@@ -4153,7 +4153,7 @@ bfa_fcs_lport_ns_boot_target_disc(bfa_fcs_lport_t *port)
for (ii = 0 ; ii < nwwns; ++ii) { for (ii = 0 ; ii < nwwns; ++ii) {
rport = bfa_fcs_rport_create_by_wwn(port, wwns[ii]); rport = bfa_fcs_rport_create_by_wwn(port, wwns[ii]);
bfa_assert(rport); WARN_ON(!rport);
} }
} }
...@@ -4616,7 +4616,7 @@ bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port, ...@@ -4616,7 +4616,7 @@ bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
default: default:
bfa_assert(0); WARN_ON(1);
nsquery = BFA_TRUE; nsquery = BFA_TRUE;
} }
} }
...@@ -4797,7 +4797,7 @@ bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, u16 vf_id, wwn_t lpwwn) ...@@ -4797,7 +4797,7 @@ bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, u16 vf_id, wwn_t lpwwn)
struct bfa_fcs_vport_s *vport; struct bfa_fcs_vport_s *vport;
bfa_fcs_vf_t *vf; bfa_fcs_vf_t *vf;
bfa_assert(fcs != NULL); WARN_ON(fcs == NULL);
vf = bfa_fcs_vf_lookup(fcs, vf_id); vf = bfa_fcs_vf_lookup(fcs, vf_id);
if (vf == NULL) { if (vf == NULL) {
......
...@@ -1968,7 +1968,7 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid) ...@@ -1968,7 +1968,7 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid)
/* /*
* allocate FC-4s * allocate FC-4s
*/ */
bfa_assert(bfa_fcs_lport_is_initiator(port)); WARN_ON(!bfa_fcs_lport_is_initiator(port));
if (bfa_fcs_lport_is_initiator(port)) { if (bfa_fcs_lport_is_initiator(port)) {
rport->itnim = bfa_fcs_itnim_create(rport); rport->itnim = bfa_fcs_itnim_create(rport);
...@@ -2897,7 +2897,7 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, ...@@ -2897,7 +2897,7 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
num_ents = be16_to_cpu(rpsc2_acc->num_pids); num_ents = be16_to_cpu(rpsc2_acc->num_pids);
bfa_trc(rport->fcs, num_ents); bfa_trc(rport->fcs, num_ents);
if (num_ents > 0) { if (num_ents > 0) {
bfa_assert(rpsc2_acc->port_info[0].pid != rport->pid); WARN_ON(rpsc2_acc->port_info[0].pid == rport->pid);
bfa_trc(rport->fcs, bfa_trc(rport->fcs,
be16_to_cpu(rpsc2_acc->port_info[0].pid)); be16_to_cpu(rpsc2_acc->port_info[0].pid));
bfa_trc(rport->fcs, bfa_trc(rport->fcs,
......
...@@ -111,7 +111,7 @@ bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs) ...@@ -111,7 +111,7 @@ bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs)
{ {
int i; int i;
bfa_assert((nvecs == 1) || (nvecs == __HFN_NUMINTS)); WARN_ON((nvecs != 1) && (nvecs != __HFN_NUMINTS));
bfa->msix.nvecs = nvecs; bfa->msix.nvecs = nvecs;
if (nvecs == 1) { if (nvecs == 1) {
......
...@@ -117,7 +117,7 @@ bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *msix_vecs_bmap, ...@@ -117,7 +117,7 @@ bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *msix_vecs_bmap,
void void
bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs) bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs)
{ {
bfa_assert((nvecs == 1) || (nvecs == BFA_MSIX_CT_MAX)); WARN_ON((nvecs != 1) && (nvecs != BFA_MSIX_CT_MAX));
bfa_trc(bfa, nvecs); bfa_trc(bfa, nvecs);
bfa->msix.nvecs = nvecs; bfa->msix.nvecs = nvecs;
...@@ -144,7 +144,7 @@ bfa_hwct_msix_install(struct bfa_s *bfa) ...@@ -144,7 +144,7 @@ bfa_hwct_msix_install(struct bfa_s *bfa)
for (; i <= BFA_MSIX_RME_Q3; i++) for (; i <= BFA_MSIX_RME_Q3; i++)
bfa->msix.handler[i] = bfa_msix_rspq; bfa->msix.handler[i] = bfa_msix_rspq;
bfa_assert(i == BFA_MSIX_LPU_ERR); WARN_ON(i != BFA_MSIX_LPU_ERR);
bfa->msix.handler[BFA_MSIX_LPU_ERR] = bfa_msix_lpu_err; bfa->msix.handler[BFA_MSIX_LPU_ERR] = bfa_msix_lpu_err;
} }
......
...@@ -1219,7 +1219,7 @@ bfa_ioc_sem_get(void __iomem *sem_reg) ...@@ -1219,7 +1219,7 @@ bfa_ioc_sem_get(void __iomem *sem_reg)
if (r32 == 0) if (r32 == 0)
return BFA_TRUE; return BFA_TRUE;
bfa_assert(cnt < BFA_SEM_SPINCNT); WARN_ON(cnt >= BFA_SEM_SPINCNT);
return BFA_FALSE; return BFA_FALSE;
} }
...@@ -1274,7 +1274,7 @@ bfa_ioc_lmem_init(struct bfa_ioc_s *ioc) ...@@ -1274,7 +1274,7 @@ bfa_ioc_lmem_init(struct bfa_ioc_s *ioc)
* If memory initialization is not successful, IOC timeout will catch * If memory initialization is not successful, IOC timeout will catch
* such failures. * such failures.
*/ */
bfa_assert(pss_ctl & __PSS_LMEM_INIT_DONE); WARN_ON(!(pss_ctl & __PSS_LMEM_INIT_DONE));
bfa_trc(ioc, pss_ctl); bfa_trc(ioc, pss_ctl);
pss_ctl &= ~(__PSS_LMEM_INIT_DONE | __PSS_LMEM_INIT_EN); pss_ctl &= ~(__PSS_LMEM_INIT_DONE | __PSS_LMEM_INIT_EN);
...@@ -1503,7 +1503,7 @@ bfa_ioc_mbox_send(struct bfa_ioc_s *ioc, void *ioc_msg, int len) ...@@ -1503,7 +1503,7 @@ bfa_ioc_mbox_send(struct bfa_ioc_s *ioc, void *ioc_msg, int len)
bfa_trc(ioc, msgp[0]); bfa_trc(ioc, msgp[0]);
bfa_trc(ioc, len); bfa_trc(ioc, len);
bfa_assert(len <= BFI_IOC_MSGLEN_MAX); WARN_ON(len > BFI_IOC_MSGLEN_MAX);
/* /*
* first write msg to mailbox registers * first write msg to mailbox registers
...@@ -2010,7 +2010,7 @@ bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *m) ...@@ -2010,7 +2010,7 @@ bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *m)
default: default:
bfa_trc(ioc, msg->mh.msg_id); bfa_trc(ioc, msg->mh.msg_id);
bfa_assert(0); WARN_ON(1);
} }
} }
...@@ -2345,7 +2345,7 @@ bfa_ioc_get_type(struct bfa_ioc_s *ioc) ...@@ -2345,7 +2345,7 @@ bfa_ioc_get_type(struct bfa_ioc_s *ioc)
else if (ioc->ioc_mc == BFI_MC_LL) else if (ioc->ioc_mc == BFI_MC_LL)
return BFA_IOC_TYPE_LL; return BFA_IOC_TYPE_LL;
else { else {
bfa_assert(ioc->ioc_mc == BFI_MC_LL); WARN_ON(ioc->ioc_mc != BFI_MC_LL);
return BFA_IOC_TYPE_LL; return BFA_IOC_TYPE_LL;
} }
} }
...@@ -2369,7 +2369,7 @@ bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver) ...@@ -2369,7 +2369,7 @@ bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver)
void void
bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev) bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev)
{ {
bfa_assert(chip_rev); WARN_ON(!chip_rev);
memset((void *)chip_rev, 0, BFA_IOC_CHIP_REV_LEN); memset((void *)chip_rev, 0, BFA_IOC_CHIP_REV_LEN);
...@@ -2401,7 +2401,7 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model) ...@@ -2401,7 +2401,7 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model)
{ {
struct bfi_ioc_attr_s *ioc_attr; struct bfi_ioc_attr_s *ioc_attr;
bfa_assert(model); WARN_ON(!model);
memset((void *)model, 0, BFA_ADAPTER_MODEL_NAME_LEN); memset((void *)model, 0, BFA_ADAPTER_MODEL_NAME_LEN);
ioc_attr = ioc->attr; ioc_attr = ioc->attr;
...@@ -2772,8 +2772,8 @@ bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer, ...@@ -2772,8 +2772,8 @@ bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer,
void (*timercb) (void *), void *arg, unsigned int timeout) void (*timercb) (void *), void *arg, unsigned int timeout)
{ {
bfa_assert(timercb != NULL); WARN_ON(timercb == NULL);
bfa_assert(!bfa_q_is_on_q(&mod->timer_q, timer)); WARN_ON(bfa_q_is_on_q(&mod->timer_q, timer));
timer->timeout = timeout; timer->timeout = timeout;
timer->timercb = timercb; timer->timercb = timercb;
...@@ -2788,7 +2788,7 @@ bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer, ...@@ -2788,7 +2788,7 @@ bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer,
void void
bfa_timer_stop(struct bfa_timer_s *timer) bfa_timer_stop(struct bfa_timer_s *timer)
{ {
bfa_assert(!list_empty(&timer->qe)); WARN_ON(list_empty(&timer->qe));
list_del(&timer->qe); list_del(&timer->qe);
} }
...@@ -113,7 +113,7 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) ...@@ -113,7 +113,7 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc)
/* /*
* Use count cannot be non-zero and chip in uninitialized state. * Use count cannot be non-zero and chip in uninitialized state.
*/ */
bfa_assert(ioc_fwstate != BFI_IOC_UNINIT); WARN_ON(ioc_fwstate == BFI_IOC_UNINIT);
/* /*
* Check if another driver with a different firmware is active * Check if another driver with a different firmware is active
...@@ -158,7 +158,7 @@ bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc) ...@@ -158,7 +158,7 @@ bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc)
*/ */
bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
usecnt = readl(ioc->ioc_regs.ioc_usage_reg); usecnt = readl(ioc->ioc_regs.ioc_usage_reg);
bfa_assert(usecnt > 0); WARN_ON(usecnt <= 0);
usecnt--; usecnt--;
writel(usecnt, ioc->ioc_regs.ioc_usage_reg); writel(usecnt, ioc->ioc_regs.ioc_usage_reg);
......
...@@ -186,7 +186,7 @@ bfa_port_isr(void *cbarg, struct bfi_mbmsg_s *m) ...@@ -186,7 +186,7 @@ bfa_port_isr(void *cbarg, struct bfi_mbmsg_s *m)
break; break;
default: default:
bfa_assert(0); WARN_ON(1);
} }
} }
...@@ -435,7 +435,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, ...@@ -435,7 +435,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
{ {
struct timeval tv; struct timeval tv;
bfa_assert(port); WARN_ON(!port);
port->dev = dev; port->dev = dev;
port->ioc = ioc; port->ioc = ioc;
......
This diff is collapsed.
...@@ -532,7 +532,7 @@ bfad_hal_mem_release(struct bfad_s *bfad) ...@@ -532,7 +532,7 @@ bfad_hal_mem_release(struct bfad_s *bfad)
(dma_addr_t) meminfo_elem->dma); (dma_addr_t) meminfo_elem->dma);
break; break;
default: default:
bfa_assert(0); WARN_ON(1);
break; break;
} }
} }
......
...@@ -449,7 +449,7 @@ bfa_fcb_itnim_free(struct bfad_s *bfad, struct bfad_itnim_s *itnim_drv) ...@@ -449,7 +449,7 @@ bfa_fcb_itnim_free(struct bfad_s *bfad, struct bfad_itnim_s *itnim_drv)
struct bfad_im_s *im = itnim_drv->im; struct bfad_im_s *im = itnim_drv->im;
/* online to free state transtion should not happen */ /* online to free state transtion should not happen */
bfa_assert(itnim_drv->state != ITNIM_STATE_ONLINE); WARN_ON(itnim_drv->state == ITNIM_STATE_ONLINE);
itnim_drv->queue_work = 1; itnim_drv->queue_work = 1;
/* offline request is not yet done, use the same request to free */ /* offline request is not yet done, use the same request to free */
...@@ -664,7 +664,7 @@ bfad_im_port_clean(struct bfad_im_port_s *im_port) ...@@ -664,7 +664,7 @@ bfad_im_port_clean(struct bfad_im_port_s *im_port)
} }
/* the itnim_mapped_list must be empty at this time */ /* the itnim_mapped_list must be empty at this time */
bfa_assert(list_empty(&im_port->itnim_mapped_list)); WARN_ON(!list_empty(&im_port->itnim_mapped_list));
spin_unlock_irqrestore(&bfad->bfad_lock, flags); spin_unlock_irqrestore(&bfad->bfad_lock, flags);
} }
...@@ -1111,7 +1111,7 @@ bfad_im_itnim_work_handler(struct work_struct *work) ...@@ -1111,7 +1111,7 @@ bfad_im_itnim_work_handler(struct work_struct *work)
kfree(itnim); kfree(itnim);
break; break;
default: default:
bfa_assert(0); WARN_ON(1);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment