aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/bfa/bfa.h4
-rw-r--r--drivers/scsi/bfa/bfa_core.c12
-rw-r--r--drivers/scsi/bfa/bfa_cs.h10
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.c42
-rw-r--r--drivers/scsi/bfa/bfa_fcs.c6
-rw-r--r--drivers/scsi/bfa/bfa_fcs_fcpim.c10
-rw-r--r--drivers/scsi/bfa/bfa_fcs_lport.c20
-rw-r--r--drivers/scsi/bfa/bfa_fcs_rport.c4
-rw-r--r--drivers/scsi/bfa/bfa_hw_cb.c2
-rw-r--r--drivers/scsi/bfa/bfa_hw_ct.c4
-rw-r--r--drivers/scsi/bfa/bfa_ioc.c20
-rw-r--r--drivers/scsi/bfa/bfa_ioc_ct.c4
-rw-r--r--drivers/scsi/bfa/bfa_port.c4
-rw-r--r--drivers/scsi/bfa/bfa_svc.c110
-rw-r--r--drivers/scsi/bfa/bfad.c2
-rw-r--r--drivers/scsi/bfa/bfad_im.c6
16 files changed, 125 insertions, 135 deletions
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
index cabc6b92b25..56a227b023a 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
@@ -120,8 +120,8 @@ bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
120 \ 120 \
121 struct list_head *waitq = bfa_reqq(__bfa, __reqq); \ 121 struct list_head *waitq = bfa_reqq(__bfa, __reqq); \
122 \ 122 \
123 bfa_assert(((__reqq) < BFI_IOC_MAX_CQS)); \ 123 WARN_ON(((__reqq) >= BFI_IOC_MAX_CQS)); \
124 bfa_assert((__wqe)->qresume && (__wqe)->cbarg); \ 124 WARN_ON(!((__wqe)->qresume && (__wqe)->cbarg)); \
125 \ 125 \
126 list_add_tail(&(__wqe)->qe, waitq); \ 126 list_add_tail(&(__wqe)->qe, waitq); \
127 } while (0) 127 } while (0)
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 3f7f3742e72..6e13ba249c8 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -285,7 +285,7 @@ bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m)
285 bfa_trc(bfa, m->mhdr.msg_class); 285 bfa_trc(bfa, m->mhdr.msg_class);
286 bfa_trc(bfa, m->mhdr.msg_id); 286 bfa_trc(bfa, m->mhdr.msg_id);
287 bfa_trc(bfa, m->mhdr.mtag.i2htok); 287 bfa_trc(bfa, m->mhdr.mtag.i2htok);
288 bfa_assert(0); 288 WARN_ON(1);
289 bfa_trc_stop(bfa->trcmod); 289 bfa_trc_stop(bfa->trcmod);
290} 290}
291 291
@@ -433,7 +433,7 @@ bfa_iocfc_send_cfg(void *bfa_arg)
433 struct bfa_iocfc_cfg_s *cfg = &iocfc->cfg; 433 struct bfa_iocfc_cfg_s *cfg = &iocfc->cfg;
434 int i; 434 int i;
435 435
436 bfa_assert(cfg->fwcfg.num_cqs <= BFI_IOC_MAX_CQS); 436 WARN_ON(cfg->fwcfg.num_cqs > BFI_IOC_MAX_CQS);
437 bfa_trc(bfa, cfg->fwcfg.num_cqs); 437 bfa_trc(bfa, cfg->fwcfg.num_cqs);
438 438
439 bfa_iocfc_reset_queues(bfa); 439 bfa_iocfc_reset_queues(bfa);
@@ -753,7 +753,7 @@ bfa_iocfc_disable_cbfn(void *bfa_arg)
753 bfa_cb_queue(bfa, &bfa->iocfc.stop_hcb_qe, bfa_iocfc_stop_cb, 753 bfa_cb_queue(bfa, &bfa->iocfc.stop_hcb_qe, bfa_iocfc_stop_cb,
754 bfa); 754 bfa);
755 else { 755 else {
756 bfa_assert(bfa->iocfc.action == BFA_IOCFC_ACT_DISABLE); 756 WARN_ON(bfa->iocfc.action != BFA_IOCFC_ACT_DISABLE);
757 bfa_cb_queue(bfa, &bfa->iocfc.dis_hcb_qe, bfa_iocfc_disable_cb, 757 bfa_cb_queue(bfa, &bfa->iocfc.dis_hcb_qe, bfa_iocfc_disable_cb,
758 bfa); 758 bfa);
759 } 759 }
@@ -894,7 +894,7 @@ bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m)
894 iocfc->updateq_cbfn(iocfc->updateq_cbarg, BFA_STATUS_OK); 894 iocfc->updateq_cbfn(iocfc->updateq_cbarg, BFA_STATUS_OK);
895 break; 895 break;
896 default: 896 default:
897 bfa_assert(0); 897 WARN_ON(1);
898 } 898 }
899} 899}
900 900
@@ -1063,7 +1063,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo)
1063 int i; 1063 int i;
1064 u32 km_len = 0, dm_len = 0; 1064 u32 km_len = 0, dm_len = 0;
1065 1065
1066 bfa_assert((cfg != NULL) && (meminfo != NULL)); 1066 WARN_ON((cfg == NULL) || (meminfo == NULL));
1067 1067
1068 memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s)); 1068 memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s));
1069 meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_type = 1069 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 1117
1118 bfa->fcs = BFA_FALSE; 1118 bfa->fcs = BFA_FALSE;
1119 1119
1120 bfa_assert((cfg != NULL) && (meminfo != NULL)); 1120 WARN_ON((cfg == NULL) || (meminfo == NULL));
1121 1121
1122 /* 1122 /*
1123 * initialize all memory pointers for iterative allocation 1123 * initialize all memory pointers for iterative allocation
diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h
index 493009d880a..913057dcb40 100644
--- a/drivers/scsi/bfa/bfa_cs.h
+++ b/drivers/scsi/bfa/bfa_cs.h
@@ -163,16 +163,6 @@ __bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data)
163#define bfa_trc_fp(_trcp, _data) 163#define bfa_trc_fp(_trcp, _data)
164#endif 164#endif
165 165
166/*
167 * @ BFA LOG interfaces
168 */
169#define bfa_assert(__cond) do { \
170 if (!(__cond)) { \
171 printk(KERN_ERR "assert(%s) failed at %s:%d\\n", \
172 #__cond, __FILE__, __LINE__); \
173 } \
174} while (0)
175
176#define bfa_sm_fault(__mod, __event) do { \ 166#define bfa_sm_fault(__mod, __event) do { \
177 bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \ 167 bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \
178 printk(KERN_ERR "Assertion failure: %s:%d: %d", \ 168 printk(KERN_ERR "Assertion failure: %s:%d: %d", \
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 5e697f236ef..f57c066725d 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -32,12 +32,12 @@ static void bfa_itnim_update_del_itn_stats(struct bfa_itnim_s *itnim);
32#define bfa_fcpim_additn(__itnim) \ 32#define bfa_fcpim_additn(__itnim) \
33 list_add_tail(&(__itnim)->qe, &(__itnim)->fcpim->itnim_q) 33 list_add_tail(&(__itnim)->qe, &(__itnim)->fcpim->itnim_q)
34#define bfa_fcpim_delitn(__itnim) do { \ 34#define bfa_fcpim_delitn(__itnim) do { \
35 bfa_assert(bfa_q_is_on_q(&(__itnim)->fcpim->itnim_q, __itnim)); \ 35 WARN_ON(!bfa_q_is_on_q(&(__itnim)->fcpim->itnim_q, __itnim)); \
36 bfa_itnim_update_del_itn_stats(__itnim); \ 36 bfa_itnim_update_del_itn_stats(__itnim); \
37 list_del(&(__itnim)->qe); \ 37 list_del(&(__itnim)->qe); \
38 bfa_assert(list_empty(&(__itnim)->io_q)); \ 38 WARN_ON(!list_empty(&(__itnim)->io_q)); \
39 bfa_assert(list_empty(&(__itnim)->io_cleanup_q)); \ 39 WARN_ON(!list_empty(&(__itnim)->io_cleanup_q)); \
40 bfa_assert(list_empty(&(__itnim)->pending_q)); \ 40 WARN_ON(!list_empty(&(__itnim)->pending_q)); \
41} while (0) 41} while (0)
42 42
43#define bfa_itnim_online_cb(__itnim) do { \ 43#define bfa_itnim_online_cb(__itnim) do { \
@@ -1184,7 +1184,7 @@ bfa_itnim_iotov_start(struct bfa_itnim_s *itnim)
1184 if (itnim->fcpim->path_tov > 0) { 1184 if (itnim->fcpim->path_tov > 0) {
1185 1185
1186 itnim->iotov_active = BFA_TRUE; 1186 itnim->iotov_active = BFA_TRUE;
1187 bfa_assert(bfa_itnim_hold_io(itnim)); 1187 WARN_ON(!bfa_itnim_hold_io(itnim));
1188 bfa_timer_start(itnim->bfa, &itnim->timer, 1188 bfa_timer_start(itnim->bfa, &itnim->timer,
1189 bfa_itnim_iotov, itnim, itnim->fcpim->path_tov); 1189 bfa_itnim_iotov, itnim, itnim->fcpim->path_tov);
1190 } 1190 }
@@ -1262,7 +1262,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1262 case BFI_ITNIM_I2H_CREATE_RSP: 1262 case BFI_ITNIM_I2H_CREATE_RSP:
1263 itnim = BFA_ITNIM_FROM_TAG(fcpim, 1263 itnim = BFA_ITNIM_FROM_TAG(fcpim,
1264 msg.create_rsp->bfa_handle); 1264 msg.create_rsp->bfa_handle);
1265 bfa_assert(msg.create_rsp->status == BFA_STATUS_OK); 1265 WARN_ON(msg.create_rsp->status != BFA_STATUS_OK);
1266 bfa_stats(itnim, create_comps); 1266 bfa_stats(itnim, create_comps);
1267 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP); 1267 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP);
1268 break; 1268 break;
@@ -1270,7 +1270,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1270 case BFI_ITNIM_I2H_DELETE_RSP: 1270 case BFI_ITNIM_I2H_DELETE_RSP:
1271 itnim = BFA_ITNIM_FROM_TAG(fcpim, 1271 itnim = BFA_ITNIM_FROM_TAG(fcpim,
1272 msg.delete_rsp->bfa_handle); 1272 msg.delete_rsp->bfa_handle);
1273 bfa_assert(msg.delete_rsp->status == BFA_STATUS_OK); 1273 WARN_ON(msg.delete_rsp->status != BFA_STATUS_OK);
1274 bfa_stats(itnim, delete_comps); 1274 bfa_stats(itnim, delete_comps);
1275 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP); 1275 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP);
1276 break; 1276 break;
@@ -1284,7 +1284,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1284 1284
1285 default: 1285 default:
1286 bfa_trc(bfa, m->mhdr.msg_id); 1286 bfa_trc(bfa, m->mhdr.msg_id);
1287 bfa_assert(0); 1287 WARN_ON(1);
1288 } 1288 }
1289} 1289}
1290 1290
@@ -1299,7 +1299,7 @@ bfa_itnim_create(struct bfa_s *bfa, struct bfa_rport_s *rport, void *ditn)
1299 struct bfa_itnim_s *itnim; 1299 struct bfa_itnim_s *itnim;
1300 1300
1301 itnim = BFA_ITNIM_FROM_TAG(fcpim, rport->rport_tag); 1301 itnim = BFA_ITNIM_FROM_TAG(fcpim, rport->rport_tag);
1302 bfa_assert(itnim->rport == rport); 1302 WARN_ON(itnim->rport != rport);
1303 1303
1304 itnim->ditn = ditn; 1304 itnim->ditn = ditn;
1305 1305
@@ -1416,7 +1416,7 @@ bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1416 * requests immediately. 1416 * requests immediately.
1417 */ 1417 */
1418 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); 1418 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb);
1419 bfa_assert(bfa_q_is_on_q(&ioim->itnim->pending_q, ioim)); 1419 WARN_ON(!bfa_q_is_on_q(&ioim->itnim->pending_q, ioim));
1420 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, 1420 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe,
1421 __bfa_cb_ioim_abort, ioim); 1421 __bfa_cb_ioim_abort, ioim);
1422 break; 1422 break;
@@ -1649,7 +1649,7 @@ bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1649 break; 1649 break;
1650 1650
1651 case BFA_IOIM_SM_CLEANUP: 1651 case BFA_IOIM_SM_CLEANUP:
1652 bfa_assert(ioim->iosp->abort_explicit == BFA_TRUE); 1652 WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE);
1653 ioim->iosp->abort_explicit = BFA_FALSE; 1653 ioim->iosp->abort_explicit = BFA_FALSE;
1654 1654
1655 if (bfa_ioim_send_abort(ioim)) 1655 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 break; 1795 break;
1796 1796
1797 case BFA_IOIM_SM_CLEANUP: 1797 case BFA_IOIM_SM_CLEANUP:
1798 bfa_assert(ioim->iosp->abort_explicit == BFA_TRUE); 1798 WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE);
1799 ioim->iosp->abort_explicit = BFA_FALSE; 1799 ioim->iosp->abort_explicit = BFA_FALSE;
1800 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); 1800 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull);
1801 break; 1801 break;
@@ -2236,7 +2236,7 @@ bfa_ioim_sgpg_alloc(struct bfa_ioim_s *ioim)
2236{ 2236{
2237 u16 nsgpgs; 2237 u16 nsgpgs;
2238 2238
2239 bfa_assert(ioim->nsges > BFI_SGE_INLINE); 2239 WARN_ON(ioim->nsges <= BFI_SGE_INLINE);
2240 2240
2241 /* 2241 /*
2242 * allocate SG pages needed 2242 * allocate SG pages needed
@@ -2444,7 +2444,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
2444 iotag = be16_to_cpu(rsp->io_tag); 2444 iotag = be16_to_cpu(rsp->io_tag);
2445 2445
2446 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); 2446 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag);
2447 bfa_assert(ioim->iotag == iotag); 2447 WARN_ON(ioim->iotag != iotag);
2448 2448
2449 bfa_trc(ioim->bfa, ioim->iotag); 2449 bfa_trc(ioim->bfa, ioim->iotag);
2450 bfa_trc(ioim->bfa, rsp->io_status); 2450 bfa_trc(ioim->bfa, rsp->io_status);
@@ -2475,13 +2475,13 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
2475 2475
2476 case BFI_IOIM_STS_PROTO_ERR: 2476 case BFI_IOIM_STS_PROTO_ERR:
2477 bfa_stats(ioim->itnim, iocom_proto_err); 2477 bfa_stats(ioim->itnim, iocom_proto_err);
2478 bfa_assert(rsp->reuse_io_tag); 2478 WARN_ON(!rsp->reuse_io_tag);
2479 evt = BFA_IOIM_SM_COMP; 2479 evt = BFA_IOIM_SM_COMP;
2480 break; 2480 break;
2481 2481
2482 case BFI_IOIM_STS_SQER_NEEDED: 2482 case BFI_IOIM_STS_SQER_NEEDED:
2483 bfa_stats(ioim->itnim, iocom_sqer_needed); 2483 bfa_stats(ioim->itnim, iocom_sqer_needed);
2484 bfa_assert(rsp->reuse_io_tag == 0); 2484 WARN_ON(rsp->reuse_io_tag != 0);
2485 evt = BFA_IOIM_SM_SQRETRY; 2485 evt = BFA_IOIM_SM_SQRETRY;
2486 break; 2486 break;
2487 2487
@@ -2510,7 +2510,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
2510 break; 2510 break;
2511 2511
2512 default: 2512 default:
2513 bfa_assert(0); 2513 WARN_ON(1);
2514 } 2514 }
2515 2515
2516 bfa_sm_send_event(ioim, evt); 2516 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 iotag = be16_to_cpu(rsp->io_tag); 2527 iotag = be16_to_cpu(rsp->io_tag);
2528 2528
2529 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); 2529 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag);
2530 bfa_assert(BFA_IOIM_TAG_2_ID(ioim->iotag) == iotag); 2530 WARN_ON(BFA_IOIM_TAG_2_ID(ioim->iotag) != iotag);
2531 2531
2532 bfa_trc_fp(ioim->bfa, ioim->iotag); 2532 bfa_trc_fp(ioim->bfa, ioim->iotag);
2533 bfa_ioim_cb_profile_comp(fcpim, ioim); 2533 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 return !memcmp(&tskim->lun, &lun, sizeof(lun)); 2944 return !memcmp(&tskim->lun, &lun, sizeof(lun));
2945 2945
2946 default: 2946 default:
2947 bfa_assert(0); 2947 WARN_ON(1);
2948 } 2948 }
2949 2949
2950 return BFA_FALSE; 2950 return BFA_FALSE;
@@ -3190,7 +3190,7 @@ bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
3190 u16 tsk_tag = be16_to_cpu(rsp->tsk_tag); 3190 u16 tsk_tag = be16_to_cpu(rsp->tsk_tag);
3191 3191
3192 tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag); 3192 tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag);
3193 bfa_assert(tskim->tsk_tag == tsk_tag); 3193 WARN_ON(tskim->tsk_tag != tsk_tag);
3194 3194
3195 tskim->tsk_status = rsp->tsk_status; 3195 tskim->tsk_status = rsp->tsk_status;
3196 3196
@@ -3225,7 +3225,7 @@ bfa_tskim_alloc(struct bfa_s *bfa, struct bfad_tskim_s *dtsk)
3225void 3225void
3226bfa_tskim_free(struct bfa_tskim_s *tskim) 3226bfa_tskim_free(struct bfa_tskim_s *tskim)
3227{ 3227{
3228 bfa_assert(bfa_q_is_on_q_func(&tskim->itnim->tsk_q, &tskim->qe)); 3228 WARN_ON(!bfa_q_is_on_q_func(&tskim->itnim->tsk_q, &tskim->qe));
3229 list_del(&tskim->qe); 3229 list_del(&tskim->qe);
3230 list_add_tail(&tskim->qe, &tskim->fcpim->tskim_free_q); 3230 list_add_tail(&tskim->qe, &tskim->fcpim->tskim_free_q);
3231} 3231}
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index e3a41b88a11..f674f931862 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -920,7 +920,7 @@ bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
920 INIT_LIST_HEAD(&fabric->vport_q); 920 INIT_LIST_HEAD(&fabric->vport_q);
921 INIT_LIST_HEAD(&fabric->vf_q); 921 INIT_LIST_HEAD(&fabric->vf_q);
922 fabric->lps = bfa_lps_alloc(fcs->bfa); 922 fabric->lps = bfa_lps_alloc(fcs->bfa);
923 bfa_assert(fabric->lps); 923 WARN_ON(!fabric->lps);
924 924
925 /* 925 /*
926 * Initialize fabric delete completion handler. Fabric deletion is 926 * 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 break; 1317 break;
1318 1318
1319 default: 1319 default:
1320 bfa_assert(0); 1320 WARN_ON(1);
1321 } 1321 }
1322} 1322}
1323 1323
@@ -1364,7 +1364,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
1364 * drop frame if vfid is unknown 1364 * drop frame if vfid is unknown
1365 */ 1365 */
1366 if (!fabric) { 1366 if (!fabric) {
1367 bfa_assert(0); 1367 WARN_ON(1);
1368 bfa_stats(fcs, uf.vfid_unknown); 1368 bfa_stats(fcs, uf.vfid_unknown);
1369 bfa_uf_free(uf); 1369 bfa_uf_free(uf);
1370 return; 1370 return;
diff --git a/drivers/scsi/bfa/bfa_fcs_fcpim.c b/drivers/scsi/bfa/bfa_fcs_fcpim.c
index 5736ef8c592..e7b49f4cb51 100644
--- a/drivers/scsi/bfa/bfa_fcs_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcs_fcpim.c
@@ -536,7 +536,7 @@ bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport)
536 if (bfa_itnim == NULL) { 536 if (bfa_itnim == NULL) {
537 bfa_trc(port->fcs, rport->pwwn); 537 bfa_trc(port->fcs, rport->pwwn);
538 bfa_fcb_itnim_free(port->fcs->bfad, itnim_drv); 538 bfa_fcb_itnim_free(port->fcs->bfad, itnim_drv);
539 bfa_assert(0); 539 WARN_ON(1);
540 return NULL; 540 return NULL;
541 } 541 }
542 542
@@ -700,7 +700,7 @@ bfa_fcs_itnim_lookup(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
700 if (!rport) 700 if (!rport)
701 return NULL; 701 return NULL;
702 702
703 bfa_assert(rport->itnim != NULL); 703 WARN_ON(rport->itnim == NULL);
704 return rport->itnim; 704 return rport->itnim;
705} 705}
706 706
@@ -729,7 +729,7 @@ bfa_fcs_itnim_stats_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
729{ 729{
730 struct bfa_fcs_itnim_s *itnim = NULL; 730 struct bfa_fcs_itnim_s *itnim = NULL;
731 731
732 bfa_assert(port != NULL); 732 WARN_ON(port == NULL);
733 733
734 itnim = bfa_fcs_itnim_lookup(port, rpwwn); 734 itnim = bfa_fcs_itnim_lookup(port, rpwwn);
735 735
@@ -746,7 +746,7 @@ bfa_fcs_itnim_stats_clear(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
746{ 746{
747 struct bfa_fcs_itnim_s *itnim = NULL; 747 struct bfa_fcs_itnim_s *itnim = NULL;
748 748
749 bfa_assert(port != NULL); 749 WARN_ON(port == NULL);
750 750
751 itnim = bfa_fcs_itnim_lookup(port, rpwwn); 751 itnim = bfa_fcs_itnim_lookup(port, rpwwn);
752 752
@@ -778,6 +778,6 @@ bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim,
778 break; 778 break;
779 779
780 default: 780 default:
781 bfa_assert(0); 781 WARN_ON(1);
782 } 782 }
783} 783}
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index eb804980cde..4e2eb92ba02 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -351,7 +351,7 @@ bfa_fcs_lport_plogi(struct bfa_fcs_lport_s *port,
351 * This is a different device with the same pid. Old device 351 * This is a different device with the same pid. Old device
352 * disappeared. Send implicit LOGO to old device. 352 * disappeared. Send implicit LOGO to old device.
353 */ 353 */
354 bfa_assert(rport->pwwn != plogi->port_name); 354 WARN_ON(rport->pwwn == plogi->port_name);
355 bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); 355 bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP);
356 356
357 /* 357 /*
@@ -364,7 +364,7 @@ bfa_fcs_lport_plogi(struct bfa_fcs_lport_s *port,
364 /* 364 /*
365 * PLOGI crossing each other. 365 * PLOGI crossing each other.
366 */ 366 */
367 bfa_assert(rport->pwwn == WWN_NULL); 367 WARN_ON(rport->pwwn != WWN_NULL);
368 bfa_fcs_rport_plogi(rport, rx_fchs, plogi); 368 bfa_fcs_rport_plogi(rport, rx_fchs, plogi);
369} 369}
370 370
@@ -532,19 +532,19 @@ bfa_fcs_lport_offline_actions(struct bfa_fcs_lport_s *port)
532static void 532static void
533bfa_fcs_lport_unknown_init(struct bfa_fcs_lport_s *port) 533bfa_fcs_lport_unknown_init(struct bfa_fcs_lport_s *port)
534{ 534{
535 bfa_assert(0); 535 WARN_ON(1);
536} 536}
537 537
538static void 538static void
539bfa_fcs_lport_unknown_online(struct bfa_fcs_lport_s *port) 539bfa_fcs_lport_unknown_online(struct bfa_fcs_lport_s *port)
540{ 540{
541 bfa_assert(0); 541 WARN_ON(1);
542} 542}
543 543
544static void 544static void
545bfa_fcs_lport_unknown_offline(struct bfa_fcs_lport_s *port) 545bfa_fcs_lport_unknown_offline(struct bfa_fcs_lport_s *port)
546{ 546{
547 bfa_assert(0); 547 WARN_ON(1);
548} 548}
549 549
550static void 550static void
@@ -777,7 +777,7 @@ bfa_fcs_lport_del_rport(
777 struct bfa_fcs_lport_s *port, 777 struct bfa_fcs_lport_s *port,
778 struct bfa_fcs_rport_s *rport) 778 struct bfa_fcs_rport_s *rport)
779{ 779{
780 bfa_assert(bfa_q_is_on_q(&port->rport_q, rport)); 780 WARN_ON(!bfa_q_is_on_q(&port->rport_q, rport));
781 list_del(&rport->qe); 781 list_del(&rport->qe);
782 port->num_rports--; 782 port->num_rports--;
783 783
@@ -1005,7 +1005,7 @@ bfa_fcs_lport_n2n_online(struct bfa_fcs_lport_s *port)
1005 */ 1005 */
1006 if (port->num_rports > 0) { 1006 if (port->num_rports > 0) {
1007 rport = bfa_fcs_lport_get_rport_by_pid(port, 0); 1007 rport = bfa_fcs_lport_get_rport_by_pid(port, 0);
1008 bfa_assert(rport != NULL); 1008 WARN_ON(rport == NULL);
1009 if (rport) { 1009 if (rport) {
1010 bfa_trc(port->fcs, rport->pwwn); 1010 bfa_trc(port->fcs, rport->pwwn);
1011 bfa_sm_send_event(rport, RPSM_EVENT_DELETE); 1011 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 4153
4154 for (ii = 0 ; ii < nwwns; ++ii) { 4154 for (ii = 0 ; ii < nwwns; ++ii) {
4155 rport = bfa_fcs_rport_create_by_wwn(port, wwns[ii]); 4155 rport = bfa_fcs_rport_create_by_wwn(port, wwns[ii]);
4156 bfa_assert(rport); 4156 WARN_ON(!rport);
4157 } 4157 }
4158} 4158}
4159 4159
@@ -4616,7 +4616,7 @@ bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
4616 4616
4617 4617
4618 default: 4618 default:
4619 bfa_assert(0); 4619 WARN_ON(1);
4620 nsquery = BFA_TRUE; 4620 nsquery = BFA_TRUE;
4621 } 4621 }
4622 } 4622 }
@@ -4797,7 +4797,7 @@ bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, u16 vf_id, wwn_t lpwwn)
4797 struct bfa_fcs_vport_s *vport; 4797 struct bfa_fcs_vport_s *vport;
4798 bfa_fcs_vf_t *vf; 4798 bfa_fcs_vf_t *vf;
4799 4799
4800 bfa_assert(fcs != NULL); 4800 WARN_ON(fcs == NULL);
4801 4801
4802 vf = bfa_fcs_vf_lookup(fcs, vf_id); 4802 vf = bfa_fcs_vf_lookup(fcs, vf_id);
4803 if (vf == NULL) { 4803 if (vf == NULL) {
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index 711f2d992a9..caaee6f0693 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -1968,7 +1968,7 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid)
1968 /* 1968 /*
1969 * allocate FC-4s 1969 * allocate FC-4s
1970 */ 1970 */
1971 bfa_assert(bfa_fcs_lport_is_initiator(port)); 1971 WARN_ON(!bfa_fcs_lport_is_initiator(port));
1972 1972
1973 if (bfa_fcs_lport_is_initiator(port)) { 1973 if (bfa_fcs_lport_is_initiator(port)) {
1974 rport->itnim = bfa_fcs_itnim_create(rport); 1974 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 num_ents = be16_to_cpu(rpsc2_acc->num_pids); 2897 num_ents = be16_to_cpu(rpsc2_acc->num_pids);
2898 bfa_trc(rport->fcs, num_ents); 2898 bfa_trc(rport->fcs, num_ents);
2899 if (num_ents > 0) { 2899 if (num_ents > 0) {
2900 bfa_assert(rpsc2_acc->port_info[0].pid != rport->pid); 2900 WARN_ON(rpsc2_acc->port_info[0].pid == rport->pid);
2901 bfa_trc(rport->fcs, 2901 bfa_trc(rport->fcs,
2902 be16_to_cpu(rpsc2_acc->port_info[0].pid)); 2902 be16_to_cpu(rpsc2_acc->port_info[0].pid));
2903 bfa_trc(rport->fcs, 2903 bfa_trc(rport->fcs,
diff --git a/drivers/scsi/bfa/bfa_hw_cb.c b/drivers/scsi/bfa/bfa_hw_cb.c
index 1fa15edabcd..977e681ec80 100644
--- a/drivers/scsi/bfa/bfa_hw_cb.c
+++ b/drivers/scsi/bfa/bfa_hw_cb.c
@@ -111,7 +111,7 @@ bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs)
111{ 111{
112 int i; 112 int i;
113 113
114 bfa_assert((nvecs == 1) || (nvecs == __HFN_NUMINTS)); 114 WARN_ON((nvecs != 1) && (nvecs != __HFN_NUMINTS));
115 115
116 bfa->msix.nvecs = nvecs; 116 bfa->msix.nvecs = nvecs;
117 if (nvecs == 1) { 117 if (nvecs == 1) {
diff --git a/drivers/scsi/bfa/bfa_hw_ct.c b/drivers/scsi/bfa/bfa_hw_ct.c
index 68077c4c4d5..21018d98a07 100644
--- a/drivers/scsi/bfa/bfa_hw_ct.c
+++ b/drivers/scsi/bfa/bfa_hw_ct.c
@@ -117,7 +117,7 @@ bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *msix_vecs_bmap,
117void 117void
118bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs) 118bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs)
119{ 119{
120 bfa_assert((nvecs == 1) || (nvecs == BFA_MSIX_CT_MAX)); 120 WARN_ON((nvecs != 1) && (nvecs != BFA_MSIX_CT_MAX));
121 bfa_trc(bfa, nvecs); 121 bfa_trc(bfa, nvecs);
122 122
123 bfa->msix.nvecs = nvecs; 123 bfa->msix.nvecs = nvecs;
@@ -144,7 +144,7 @@ bfa_hwct_msix_install(struct bfa_s *bfa)
144 for (; i <= BFA_MSIX_RME_Q3; i++) 144 for (; i <= BFA_MSIX_RME_Q3; i++)
145 bfa->msix.handler[i] = bfa_msix_rspq; 145 bfa->msix.handler[i] = bfa_msix_rspq;
146 146
147 bfa_assert(i == BFA_MSIX_LPU_ERR); 147 WARN_ON(i != BFA_MSIX_LPU_ERR);
148 bfa->msix.handler[BFA_MSIX_LPU_ERR] = bfa_msix_lpu_err; 148 bfa->msix.handler[BFA_MSIX_LPU_ERR] = bfa_msix_lpu_err;
149} 149}
150 150
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 05b0ff93284..431cf72f742 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -1219,7 +1219,7 @@ bfa_ioc_sem_get(void __iomem *sem_reg)
1219 if (r32 == 0) 1219 if (r32 == 0)
1220 return BFA_TRUE; 1220 return BFA_TRUE;
1221 1221
1222 bfa_assert(cnt < BFA_SEM_SPINCNT); 1222 WARN_ON(cnt >= BFA_SEM_SPINCNT);
1223 return BFA_FALSE; 1223 return BFA_FALSE;
1224} 1224}
1225 1225
@@ -1274,7 +1274,7 @@ bfa_ioc_lmem_init(struct bfa_ioc_s *ioc)
1274 * If memory initialization is not successful, IOC timeout will catch 1274 * If memory initialization is not successful, IOC timeout will catch
1275 * such failures. 1275 * such failures.
1276 */ 1276 */
1277 bfa_assert(pss_ctl & __PSS_LMEM_INIT_DONE); 1277 WARN_ON(!(pss_ctl & __PSS_LMEM_INIT_DONE));
1278 bfa_trc(ioc, pss_ctl); 1278 bfa_trc(ioc, pss_ctl);
1279 1279
1280 pss_ctl &= ~(__PSS_LMEM_INIT_DONE | __PSS_LMEM_INIT_EN); 1280 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 bfa_trc(ioc, msgp[0]); 1503 bfa_trc(ioc, msgp[0]);
1504 bfa_trc(ioc, len); 1504 bfa_trc(ioc, len);
1505 1505
1506 bfa_assert(len <= BFI_IOC_MSGLEN_MAX); 1506 WARN_ON(len > BFI_IOC_MSGLEN_MAX);
1507 1507
1508 /* 1508 /*
1509 * first write msg to mailbox registers 1509 * first write msg to mailbox registers
@@ -2010,7 +2010,7 @@ bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *m)
2010 2010
2011 default: 2011 default:
2012 bfa_trc(ioc, msg->mh.msg_id); 2012 bfa_trc(ioc, msg->mh.msg_id);
2013 bfa_assert(0); 2013 WARN_ON(1);
2014 } 2014 }
2015} 2015}
2016 2016
@@ -2345,7 +2345,7 @@ bfa_ioc_get_type(struct bfa_ioc_s *ioc)
2345 else if (ioc->ioc_mc == BFI_MC_LL) 2345 else if (ioc->ioc_mc == BFI_MC_LL)
2346 return BFA_IOC_TYPE_LL; 2346 return BFA_IOC_TYPE_LL;
2347 else { 2347 else {
2348 bfa_assert(ioc->ioc_mc == BFI_MC_LL); 2348 WARN_ON(ioc->ioc_mc != BFI_MC_LL);
2349 return BFA_IOC_TYPE_LL; 2349 return BFA_IOC_TYPE_LL;
2350 } 2350 }
2351} 2351}
@@ -2369,7 +2369,7 @@ bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver)
2369void 2369void
2370bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev) 2370bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev)
2371{ 2371{
2372 bfa_assert(chip_rev); 2372 WARN_ON(!chip_rev);
2373 2373
2374 memset((void *)chip_rev, 0, BFA_IOC_CHIP_REV_LEN); 2374 memset((void *)chip_rev, 0, BFA_IOC_CHIP_REV_LEN);
2375 2375
@@ -2401,7 +2401,7 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model)
2401{ 2401{
2402 struct bfi_ioc_attr_s *ioc_attr; 2402 struct bfi_ioc_attr_s *ioc_attr;
2403 2403
2404 bfa_assert(model); 2404 WARN_ON(!model);
2405 memset((void *)model, 0, BFA_ADAPTER_MODEL_NAME_LEN); 2405 memset((void *)model, 0, BFA_ADAPTER_MODEL_NAME_LEN);
2406 2406
2407 ioc_attr = ioc->attr; 2407 ioc_attr = ioc->attr;
@@ -2772,8 +2772,8 @@ bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer,
2772 void (*timercb) (void *), void *arg, unsigned int timeout) 2772 void (*timercb) (void *), void *arg, unsigned int timeout)
2773{ 2773{
2774 2774
2775 bfa_assert(timercb != NULL); 2775 WARN_ON(timercb == NULL);
2776 bfa_assert(!bfa_q_is_on_q(&mod->timer_q, timer)); 2776 WARN_ON(bfa_q_is_on_q(&mod->timer_q, timer));
2777 2777
2778 timer->timeout = timeout; 2778 timer->timeout = timeout;
2779 timer->timercb = timercb; 2779 timer->timercb = timercb;
@@ -2788,7 +2788,7 @@ bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer,
2788void 2788void
2789bfa_timer_stop(struct bfa_timer_s *timer) 2789bfa_timer_stop(struct bfa_timer_s *timer)
2790{ 2790{
2791 bfa_assert(!list_empty(&timer->qe)); 2791 WARN_ON(list_empty(&timer->qe));
2792 2792
2793 list_del(&timer->qe); 2793 list_del(&timer->qe);
2794} 2794}
diff --git a/drivers/scsi/bfa/bfa_ioc_ct.c b/drivers/scsi/bfa/bfa_ioc_ct.c
index 9da55a836bf..ccfecfca074 100644
--- a/drivers/scsi/bfa/bfa_ioc_ct.c
+++ b/drivers/scsi/bfa/bfa_ioc_ct.c
@@ -113,7 +113,7 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc)
113 /* 113 /*
114 * Use count cannot be non-zero and chip in uninitialized state. 114 * Use count cannot be non-zero and chip in uninitialized state.
115 */ 115 */
116 bfa_assert(ioc_fwstate != BFI_IOC_UNINIT); 116 WARN_ON(ioc_fwstate == BFI_IOC_UNINIT);
117 117
118 /* 118 /*
119 * Check if another driver with a different firmware is active 119 * 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 */ 158 */
159 bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); 159 bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
160 usecnt = readl(ioc->ioc_regs.ioc_usage_reg); 160 usecnt = readl(ioc->ioc_regs.ioc_usage_reg);
161 bfa_assert(usecnt > 0); 161 WARN_ON(usecnt <= 0);
162 162
163 usecnt--; 163 usecnt--;
164 writel(usecnt, ioc->ioc_regs.ioc_usage_reg); 164 writel(usecnt, ioc->ioc_regs.ioc_usage_reg);
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c
index 45b3486cca9..3f8e9d6066e 100644
--- a/drivers/scsi/bfa/bfa_port.c
+++ b/drivers/scsi/bfa/bfa_port.c
@@ -186,7 +186,7 @@ bfa_port_isr(void *cbarg, struct bfi_mbmsg_s *m)
186 break; 186 break;
187 187
188 default: 188 default:
189 bfa_assert(0); 189 WARN_ON(1);
190 } 190 }
191} 191}
192 192
@@ -435,7 +435,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
435{ 435{
436 struct timeval tv; 436 struct timeval tv;
437 437
438 bfa_assert(port); 438 WARN_ON(!port);
439 439
440 port->dev = dev; 440 port->dev = dev;
441 port->ioc = ioc; 441 port->ioc = ioc;
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index b7df5534da8..d33e93a7a67 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
1102bfa_fcxp_abort(struct bfa_fcxp_s *fcxp) 1102bfa_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)
4543void 4543void
4544bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info) 4544bfa_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)
4561void 4561void
4562bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed) 4562bfa_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
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index c80540e576c..4e94d28ae32 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -532,7 +532,7 @@ bfad_hal_mem_release(struct bfad_s *bfad)
532 (dma_addr_t) meminfo_elem->dma); 532 (dma_addr_t) meminfo_elem->dma);
533 break; 533 break;
534 default: 534 default:
535 bfa_assert(0); 535 WARN_ON(1);
536 break; 536 break;
537 } 537 }
538 } 538 }
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 53cea3d3335..f0bcda8f077 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -449,7 +449,7 @@ bfa_fcb_itnim_free(struct bfad_s *bfad, struct bfad_itnim_s *itnim_drv)
449 struct bfad_im_s *im = itnim_drv->im; 449 struct bfad_im_s *im = itnim_drv->im;
450 450
451 /* online to free state transtion should not happen */ 451 /* online to free state transtion should not happen */
452 bfa_assert(itnim_drv->state != ITNIM_STATE_ONLINE); 452 WARN_ON(itnim_drv->state == ITNIM_STATE_ONLINE);
453 453
454 itnim_drv->queue_work = 1; 454 itnim_drv->queue_work = 1;
455 /* offline request is not yet done, use the same request to free */ 455 /* 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 } 664 }
665 665
666 /* the itnim_mapped_list must be empty at this time */ 666 /* the itnim_mapped_list must be empty at this time */
667 bfa_assert(list_empty(&im_port->itnim_mapped_list)); 667 WARN_ON(!list_empty(&im_port->itnim_mapped_list));
668 668
669 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 669 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
670} 670}
@@ -1111,7 +1111,7 @@ bfad_im_itnim_work_handler(struct work_struct *work)
1111 kfree(itnim); 1111 kfree(itnim);
1112 break; 1112 break;
1113 default: 1113 default:
1114 bfa_assert(0); 1114 WARN_ON(1);
1115 break; 1115 break;
1116 } 1116 }
1117 1117