From 3f77595dbd9b47fe48b92da0dd69fba788dc7232 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 20 Jul 2014 06:52:12 +0000 Subject: [PATCH] Change BUG_ON(1) into BUG() (merge r5618 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5695 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 2 +- iscsi-scst/kernel/nthread.c | 2 +- mvsas_tgt/mv_init.c | 2 +- mvsas_tgt/mv_tgt.c | 2 +- qla2x00t/qla2x00-target/qla2x00t.c | 6 +++--- scst/include/scst_debug.h | 2 ++ scst/src/dev_handlers/scst_user.c | 2 +- scst/src/dev_handlers/scst_vdisk.c | 4 ++-- scst/src/scst_lib.c | 4 ++-- scst/src/scst_targ.c | 2 +- 10 files changed, 15 insertions(+), 13 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 87043aad0..6c9d7e091 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -3609,7 +3609,7 @@ static void iscsi_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd) case SCST_ABORT_ALL_TASKS_SESS: case SCST_ABORT_ALL_TASKS: case SCST_NEXUS_LOSS: - sBUG_ON(1); + sBUG(); break; default: iscsi_send_task_mgmt_resp(req, status, scst_mgmt_cmd_dropped(scst_mcmd)); diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index 9aed7b8c6..57d439665 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -368,7 +368,7 @@ void iscsi_task_mgmt_affected_cmds_done(struct scst_mgmt_cmd *scst_mcmd) case SCST_ABORT_ALL_TASKS_SESS: case SCST_ABORT_ALL_TASKS: case SCST_NEXUS_LOSS: - sBUG_ON(1); + sBUG(); break; default: /* Nothing to do */ diff --git a/mvsas_tgt/mv_init.c b/mvsas_tgt/mv_init.c index e5d78b8c6..4e381ba9d 100644 --- a/mvsas_tgt/mv_init.c +++ b/mvsas_tgt/mv_init.c @@ -193,7 +193,7 @@ static void mvs_tasklet(unsigned long opaque) mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[0]; if (unlikely(!mvi)) - BUG_ON(1); + BUG(); for (i = 0; i < core_nr; i++) { mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[i]; diff --git a/mvsas_tgt/mv_tgt.c b/mvsas_tgt/mv_tgt.c index f1d86de89..86c5a49fa 100644 --- a/mvsas_tgt/mv_tgt.c +++ b/mvsas_tgt/mv_tgt.c @@ -1224,7 +1224,7 @@ static void mvst_do_cmd_completion(struct mvs_info *mvi, TRACE_DBG("Read data command %p finished", cmd); if (err) { cmd->cmd_state = MVST_STATE_SEND_DATA_RETRY; - sBUG_ON(1); + sBUG(); } goto out; } else if (cmd->cmd_state == MVST_STATE_ABORTED) { diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index cb8e75056..3741f88fa 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -5606,7 +5606,7 @@ static void q2t_exec_sess_work(struct q2t_tgt *tgt, loop_id = GET_TARGET_ID(ha, &prm->tm_iocb); break; default: - sBUG_ON(1); + sBUG(); break; } @@ -5683,7 +5683,7 @@ send: break; } default: - sBUG_ON(1); + sBUG(); break; } @@ -5733,7 +5733,7 @@ out_term: 0, 0, 0, 0, 0); break; default: - sBUG_ON(1); + sBUG(); break; } goto out_put; diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index 5af2c6f5c..264c2af9c 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -108,10 +108,12 @@ #endif #ifdef CONFIG_SCST_EXTRACHECKS +#define EXTRACHECKS_BUG() sBUG() #define EXTRACHECKS_BUG_ON(a) sBUG_ON(a) #define EXTRACHECKS_WARN_ON(a) WARN_ON(a) #define EXTRACHECKS_WARN_ON_ONCE(a) WARN_ON_ONCE(a) #else +#define EXTRACHECKS_BUG() do { } while (0) #define EXTRACHECKS_BUG_ON(a) do { } while (0) #define EXTRACHECKS_WARN_ON(a) do { } while (0) #define EXTRACHECKS_WARN_ON_ONCE(a) do { } while (0) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index e2cf60d26..0ba4f86bc 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -1911,7 +1911,7 @@ again: dev_user_unjam_cmd(u, 0, NULL); goto again; case UCMD_STATE_EXECING: - EXTRACHECKS_BUG_ON(1); + EXTRACHECKS_BUG(); } } } diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 6b0bcbf08..6917d995e 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1654,7 +1654,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p) } break; default: - sBUG_ON(1); + sBUG(); break; } } @@ -3749,7 +3749,7 @@ static int vdisk_caching_pg(unsigned char *p, int pcontrol, p[2] |= (virt_dev->wt_flag_saved || virt_dev->nv_cache) ? 0 : WCE; break; default: - sBUG_ON(1); + sBUG(); break; } diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 46d2b3a1b..1b5552bc4 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -9413,7 +9413,7 @@ int scst_parse_descriptors(struct scst_cmd *cmd) res = scst_parse_unmap_descriptors(cmd); break; default: - sBUG_ON(1); + sBUG(); res = -1; break; } @@ -9431,7 +9431,7 @@ static void scst_free_descriptors(struct scst_cmd *cmd) scst_free_unmap_descriptors(cmd); break; default: - sBUG_ON(1); + sBUG(); break; } diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index b46414b31..153c71c7b 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -2288,7 +2288,7 @@ static int scst_report_supported_opcodes(struct scst_cmd *cmd) } break; default: - sBUG_ON(1); + sBUG(); goto out_compl; }