aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2012-02-06 18:39:35 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-09 12:38:19 -0500
commit40e6336d1bdc10f072b6563dfb1255b5c4b039a2 (patch)
treecc6aae8dfc2f8102771469247a0d55ead38178a3 /drivers
parent276cc746d58b73aa4e046745441b8cf56858f9ef (diff)
staging: tidspbridge: remove DBC_ASSERT macro
This macro is only valid when CONFIG_TIDSPBRDIGE_DEBUG is enabled and it only prints a log message, it is not a real assertion mechanism like BUG_ON() or WARN_ON(). It is better to remove them: less code to maintain. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/tidspbridge/core/chnl_sm.c12
-rw-r--r--drivers/staging/tidspbridge/core/io_sm.c14
-rw-r--r--drivers/staging/tidspbridge/core/tiomap3430.c3
-rw-r--r--drivers/staging/tidspbridge/core/tiomap3430_pwr.c1
-rw-r--r--drivers/staging/tidspbridge/core/tiomap_io.c15
-rw-r--r--drivers/staging/tidspbridge/include/dspbridge/dbc.h11
-rw-r--r--drivers/staging/tidspbridge/pmgr/cmm.c6
-rw-r--r--drivers/staging/tidspbridge/pmgr/dbll.c3
-rw-r--r--drivers/staging/tidspbridge/pmgr/dev.c6
-rw-r--r--drivers/staging/tidspbridge/rmgr/dbdcd.c6
-rw-r--r--drivers/staging/tidspbridge/rmgr/disp.c3
-rw-r--r--drivers/staging/tidspbridge/rmgr/drv.c7
-rw-r--r--drivers/staging/tidspbridge/rmgr/drv_interface.c2
-rw-r--r--drivers/staging/tidspbridge/rmgr/mgr.c2
-rw-r--r--drivers/staging/tidspbridge/rmgr/nldr.c22
-rw-r--r--drivers/staging/tidspbridge/rmgr/node.c11
-rw-r--r--drivers/staging/tidspbridge/rmgr/proc.c15
-rw-r--r--drivers/staging/tidspbridge/rmgr/rmm.c3
-rw-r--r--drivers/staging/tidspbridge/rmgr/strm.c11
19 files changed, 2 insertions, 151 deletions
diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c
index 91daf25d29a..3136e8ddad4 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -123,7 +123,6 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf,
123 CHNL_IS_OUTPUT(pchnl->chnl_mode)) 123 CHNL_IS_OUTPUT(pchnl->chnl_mode))
124 return -EPIPE; 124 return -EPIPE;
125 /* No other possible states left */ 125 /* No other possible states left */
126 DBC_ASSERT(0);
127 } 126 }
128 127
129 dev_obj = dev_get_first(); 128 dev_obj = dev_get_first();
@@ -190,7 +189,6 @@ func_cont:
190 * Note: for dma chans dw_dsp_addr contains dsp address 189 * Note: for dma chans dw_dsp_addr contains dsp address
191 * of SM buffer. 190 * of SM buffer.
192 */ 191 */
193 DBC_ASSERT(chnl_mgr_obj->word_size != 0);
194 /* DSP address */ 192 /* DSP address */
195 chnl_packet_obj->dsp_tx_addr = dw_dsp_addr / chnl_mgr_obj->word_size; 193 chnl_packet_obj->dsp_tx_addr = dw_dsp_addr / chnl_mgr_obj->word_size;
196 chnl_packet_obj->byte_size = byte_size; 194 chnl_packet_obj->byte_size = byte_size;
@@ -201,7 +199,6 @@ func_cont:
201 CHNL_IOCSTATCOMPLETE); 199 CHNL_IOCSTATCOMPLETE);
202 list_add_tail(&chnl_packet_obj->link, &pchnl->io_requests); 200 list_add_tail(&chnl_packet_obj->link, &pchnl->io_requests);
203 pchnl->cio_reqs++; 201 pchnl->cio_reqs++;
204 DBC_ASSERT(pchnl->cio_reqs <= pchnl->chnl_packets);
205 /* 202 /*
206 * If end of stream, update the channel state to prevent 203 * If end of stream, update the channel state to prevent
207 * more IOR's. 204 * more IOR's.
@@ -209,8 +206,6 @@ func_cont:
209 if (is_eos) 206 if (is_eos)
210 pchnl->state |= CHNL_STATEEOS; 207 pchnl->state |= CHNL_STATEEOS;
211 208
212 /* Legacy DSM Processor-Copy */
213 DBC_ASSERT(pchnl->chnl_type == CHNL_PCPY);
214 /* Request IO from the DSP */ 209 /* Request IO from the DSP */
215 io_request_chnl(chnl_mgr_obj->iomgr, pchnl, 210 io_request_chnl(chnl_mgr_obj->iomgr, pchnl,
216 (CHNL_IS_INPUT(pchnl->chnl_mode) ? IO_INPUT : 211 (CHNL_IS_INPUT(pchnl->chnl_mode) ? IO_INPUT :
@@ -283,7 +278,6 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj)
283 list_add_tail(&chirp->link, &pchnl->io_completions); 278 list_add_tail(&chirp->link, &pchnl->io_completions);
284 pchnl->cio_cs++; 279 pchnl->cio_cs++;
285 pchnl->cio_reqs--; 280 pchnl->cio_reqs--;
286 DBC_ASSERT(pchnl->cio_reqs >= 0);
287 } 281 }
288 282
289 spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); 283 spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock);
@@ -311,8 +305,6 @@ int bridge_chnl_close(struct chnl_object *chnl_obj)
311 status = bridge_chnl_cancel_io(chnl_obj); 305 status = bridge_chnl_cancel_io(chnl_obj);
312 if (status) 306 if (status)
313 return status; 307 return status;
314 /* Assert I/O on this channel is now cancelled: Protects from io_dpc */
315 DBC_ASSERT((pchnl->state & CHNL_STATECANCEL));
316 /* Invalidate channel object: Protects from CHNL_GetIOCompletion() */ 308 /* Invalidate channel object: Protects from CHNL_GetIOCompletion() */
317 /* Free the slot in the channel manager: */ 309 /* Free the slot in the channel manager: */
318 pchnl->chnl_mgr_obj->channels[pchnl->chnl_id] = NULL; 310 pchnl->chnl_mgr_obj->channels[pchnl->chnl_id] = NULL;
@@ -367,7 +359,6 @@ int bridge_chnl_create(struct chnl_mgr **channel_mgr,
367 * mgr_attrts->max_channels = CHNL_MAXCHANNELS = 359 * mgr_attrts->max_channels = CHNL_MAXCHANNELS =
368 * DDMA_MAXDDMACHNLS = DDMA_MAXZCPYCHNLS. 360 * DDMA_MAXDDMACHNLS = DDMA_MAXZCPYCHNLS.
369 */ 361 */
370 DBC_ASSERT(mgr_attrts->max_channels == CHNL_MAXCHANNELS);
371 max_channels = CHNL_MAXCHANNELS + CHNL_MAXCHANNELS * CHNL_PCPY; 362 max_channels = CHNL_MAXCHANNELS + CHNL_MAXCHANNELS * CHNL_PCPY;
372 /* Create array of channels */ 363 /* Create array of channels */
373 chnl_mgr_obj->channels = kzalloc(sizeof(struct chnl_object *) 364 chnl_mgr_obj->channels = kzalloc(sizeof(struct chnl_object *)
@@ -584,7 +575,6 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
584 omap_mbox_disable_irq(dev_ctxt->mbox, IRQ_RX); 575 omap_mbox_disable_irq(dev_ctxt->mbox, IRQ_RX);
585 if (dequeue_ioc) { 576 if (dequeue_ioc) {
586 /* Dequeue IOC and set chan_ioc; */ 577 /* Dequeue IOC and set chan_ioc; */
587 DBC_ASSERT(!list_empty(&pchnl->io_completions));
588 chnl_packet_obj = list_first_entry(&pchnl->io_completions, 578 chnl_packet_obj = list_first_entry(&pchnl->io_completions,
589 struct chnl_irp, link); 579 struct chnl_irp, link);
590 list_del(&chnl_packet_obj->link); 580 list_del(&chnl_packet_obj->link);
@@ -748,7 +738,6 @@ int bridge_chnl_open(struct chnl_object **chnl,
748 return status; 738 return status;
749 } 739 }
750 740
751 DBC_ASSERT(ch_id < chnl_mgr_obj->max_channels);
752 741
753 /* Create channel object: */ 742 /* Create channel object: */
754 pchnl = kzalloc(sizeof(struct chnl_object), GFP_KERNEL); 743 pchnl = kzalloc(sizeof(struct chnl_object), GFP_KERNEL);
@@ -837,7 +826,6 @@ int bridge_chnl_register_notify(struct chnl_object *chnl_obj,
837{ 826{
838 int status = 0; 827 int status = 0;
839 828
840 DBC_ASSERT(!(event_mask & ~(DSP_STREAMDONE | DSP_STREAMIOCOMPLETION)));
841 829
842 if (event_mask) 830 if (event_mask)
843 status = ntfy_register(chnl_obj->ntfy_obj, hnotification, 831 status = ntfy_register(chnl_obj->ntfy_obj, hnotification,
diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c
index 694c0e5e55c..0930a9851f3 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -973,29 +973,16 @@ void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl,
973 chnl_mgr_obj = io_manager->chnl_mgr; 973 chnl_mgr_obj = io_manager->chnl_mgr;
974 sm = io_manager->shared_mem; 974 sm = io_manager->shared_mem;
975 if (io_mode == IO_INPUT) { 975 if (io_mode == IO_INPUT) {
976 /*
977 * Assertion fires if CHNL_AddIOReq() called on a stream
978 * which was cancelled, or attached to a dead board.
979 */
980 DBC_ASSERT((pchnl->state == CHNL_STATEREADY) ||
981 (pchnl->state == CHNL_STATEEOS));
982 /* Indicate to the DSP we have a buffer available for input */ 976 /* Indicate to the DSP we have a buffer available for input */
983 set_chnl_busy(sm, pchnl->chnl_id); 977 set_chnl_busy(sm, pchnl->chnl_id);
984 *mbx_val = MBX_PCPY_CLASS; 978 *mbx_val = MBX_PCPY_CLASS;
985 } else if (io_mode == IO_OUTPUT) { 979 } else if (io_mode == IO_OUTPUT) {
986 /* 980 /*
987 * This assertion fails if CHNL_AddIOReq() was called on a
988 * stream which was cancelled, or attached to a dead board.
989 */
990 DBC_ASSERT((pchnl->state & ~CHNL_STATEEOS) ==
991 CHNL_STATEREADY);
992 /*
993 * Record the fact that we have a buffer available for 981 * Record the fact that we have a buffer available for
994 * output. 982 * output.
995 */ 983 */
996 chnl_mgr_obj->output_mask |= (1 << pchnl->chnl_id); 984 chnl_mgr_obj->output_mask |= (1 << pchnl->chnl_id);
997 } else { 985 } else {
998 DBC_ASSERT(io_mode); /* Shouldn't get here. */
999 } 986 }
1000func_end: 987func_end:
1001 return; 988 return;
@@ -1087,7 +1074,6 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
1087 dw_arg = sm->arg; 1074 dw_arg = sm->arg;
1088 if (chnl_id >= CHNL_MAXCHANNELS) { 1075 if (chnl_id >= CHNL_MAXCHANNELS) {
1089 /* Shouldn't be here: would indicate corrupted shm. */ 1076 /* Shouldn't be here: would indicate corrupted shm. */
1090 DBC_ASSERT(chnl_id);
1091 goto func_end; 1077 goto func_end;
1092 } 1078 }
1093 pchnl = chnl_mgr_obj->channels[chnl_id]; 1079 pchnl = chnl_mgr_obj->channels[chnl_id];
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c
index 212cbc9414d..c3efc2ec455 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -396,16 +396,13 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
396 (void)dev_get_symbol(dev_context->dev_obj, SHMBASENAME, 396 (void)dev_get_symbol(dev_context->dev_obj, SHMBASENAME,
397 &ul_shm_base_virt); 397 &ul_shm_base_virt);
398 ul_shm_base_virt *= DSPWORDSIZE; 398 ul_shm_base_virt *= DSPWORDSIZE;
399 DBC_ASSERT(ul_shm_base_virt != 0);
400 /* DSP Virtual address */ 399 /* DSP Virtual address */
401 ul_tlb_base_virt = dev_context->atlb_entry[0].dsp_va; 400 ul_tlb_base_virt = dev_context->atlb_entry[0].dsp_va;
402 DBC_ASSERT(ul_tlb_base_virt <= ul_shm_base_virt);
403 ul_shm_offset_virt = 401 ul_shm_offset_virt =
404 ul_shm_base_virt - (ul_tlb_base_virt * DSPWORDSIZE); 402 ul_shm_base_virt - (ul_tlb_base_virt * DSPWORDSIZE);
405 /* Kernel logical address */ 403 /* Kernel logical address */
406 ul_shm_base = dev_context->atlb_entry[0].gpp_va + ul_shm_offset_virt; 404 ul_shm_base = dev_context->atlb_entry[0].gpp_va + ul_shm_offset_virt;
407 405
408 DBC_ASSERT(ul_shm_base != 0);
409 /* 2nd wd is used as sync field */ 406 /* 2nd wd is used as sync field */
410 dw_sync_addr = ul_shm_base + SHMSYNCOFFSET; 407 dw_sync_addr = ul_shm_base + SHMSYNCOFFSET;
411 /* Write a signature into the shm base + offset; this will 408 /* Write a signature into the shm base + offset; this will
diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
index 02dd4391309..16a4aafa86a 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
@@ -303,7 +303,6 @@ int dsp_peripheral_clk_ctrl(struct bridge_dev_context *dev_context,
303 } 303 }
304 /* TODO -- Assert may be a too hard restriction here.. May be we should 304 /* TODO -- Assert may be a too hard restriction here.. May be we should
305 * just return with failure when the CLK ID does not match */ 305 * just return with failure when the CLK ID does not match */
306 /* DBC_ASSERT(clk_id_index < MBX_PM_MAX_RESOURCES); */
307 if (clk_id_index == MBX_PM_MAX_RESOURCES) { 306 if (clk_id_index == MBX_PM_MAX_RESOURCES) {
308 /* return with a more meaningfull error code */ 307 /* return with a more meaningfull error code */
309 return -EPERM; 308 return -EPERM;
diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c
index dfb356eb672..9c1887390ae 100644
--- a/drivers/staging/tidspbridge/core/tiomap_io.c
+++ b/drivers/staging/tidspbridge/core/tiomap_io.c
@@ -68,20 +68,17 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt,
68 status = dev_get_symbol(dev_context->dev_obj, 68 status = dev_get_symbol(dev_context->dev_obj,
69 SHMBASENAME, &ul_shm_base_virt); 69 SHMBASENAME, &ul_shm_base_virt);
70 } 70 }
71 DBC_ASSERT(ul_shm_base_virt != 0);
72 71
73 /* Check if it is a read of Trace section */ 72 /* Check if it is a read of Trace section */
74 if (!status && !ul_trace_sec_beg) { 73 if (!status && !ul_trace_sec_beg) {
75 status = dev_get_symbol(dev_context->dev_obj, 74 status = dev_get_symbol(dev_context->dev_obj,
76 DSP_TRACESEC_BEG, &ul_trace_sec_beg); 75 DSP_TRACESEC_BEG, &ul_trace_sec_beg);
77 } 76 }
78 DBC_ASSERT(ul_trace_sec_beg != 0);
79 77
80 if (!status && !ul_trace_sec_end) { 78 if (!status && !ul_trace_sec_end) {
81 status = dev_get_symbol(dev_context->dev_obj, 79 status = dev_get_symbol(dev_context->dev_obj,
82 DSP_TRACESEC_END, &ul_trace_sec_end); 80 DSP_TRACESEC_END, &ul_trace_sec_end);
83 } 81 }
84 DBC_ASSERT(ul_trace_sec_end != 0);
85 82
86 if (!status) { 83 if (!status) {
87 if ((dsp_addr <= ul_trace_sec_end) && 84 if ((dsp_addr <= ul_trace_sec_end) &&
@@ -105,19 +102,16 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt,
105 status = dev_get_symbol(dev_context->dev_obj, 102 status = dev_get_symbol(dev_context->dev_obj,
106 DYNEXTBASE, &ul_dyn_ext_base); 103 DYNEXTBASE, &ul_dyn_ext_base);
107 } 104 }
108 DBC_ASSERT(ul_dyn_ext_base != 0);
109 105
110 if (!status) { 106 if (!status) {
111 status = dev_get_symbol(dev_context->dev_obj, 107 status = dev_get_symbol(dev_context->dev_obj,
112 EXTBASE, &ul_ext_base); 108 EXTBASE, &ul_ext_base);
113 } 109 }
114 DBC_ASSERT(ul_ext_base != 0);
115 110
116 if (!status) { 111 if (!status) {
117 status = dev_get_symbol(dev_context->dev_obj, 112 status = dev_get_symbol(dev_context->dev_obj,
118 EXTEND, &ul_ext_end); 113 EXTEND, &ul_ext_end);
119 } 114 }
120 DBC_ASSERT(ul_ext_end != 0);
121 115
122 /* Trace buffer is right after the shm SEG0, 116 /* Trace buffer is right after the shm SEG0,
123 * so set the base address to SHMBASE */ 117 * so set the base address to SHMBASE */
@@ -126,8 +120,6 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt,
126 ul_ext_end = ul_trace_sec_end; 120 ul_ext_end = ul_trace_sec_end;
127 } 121 }
128 122
129 DBC_ASSERT(ul_ext_end != 0);
130 DBC_ASSERT(ul_ext_end > ul_ext_base);
131 123
132 if (ul_ext_end < ul_ext_base) 124 if (ul_ext_end < ul_ext_base)
133 status = -EPERM; 125 status = -EPERM;
@@ -135,7 +127,6 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt,
135 if (!status) { 127 if (!status) {
136 ul_tlb_base_virt = 128 ul_tlb_base_virt =
137 dev_context->atlb_entry[0].dsp_va * DSPWORDSIZE; 129 dev_context->atlb_entry[0].dsp_va * DSPWORDSIZE;
138 DBC_ASSERT(ul_tlb_base_virt <= ul_shm_base_virt);
139 dw_ext_prog_virt_mem = 130 dw_ext_prog_virt_mem =
140 dev_context->atlb_entry[0].gpp_va; 131 dev_context->atlb_entry[0].gpp_va;
141 132
@@ -271,7 +262,6 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context,
271 /* Get SHM_BEG EXT_BEG and EXT_END. */ 262 /* Get SHM_BEG EXT_BEG and EXT_END. */
272 ret = dev_get_symbol(dev_context->dev_obj, 263 ret = dev_get_symbol(dev_context->dev_obj,
273 SHMBASENAME, &ul_shm_base_virt); 264 SHMBASENAME, &ul_shm_base_virt);
274 DBC_ASSERT(ul_shm_base_virt != 0);
275 if (dynamic_load) { 265 if (dynamic_load) {
276 if (!ret) { 266 if (!ret) {
277 if (symbols_reloaded) 267 if (symbols_reloaded)
@@ -280,7 +270,6 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context,
280 (dev_context->dev_obj, DYNEXTBASE, 270 (dev_context->dev_obj, DYNEXTBASE,
281 &ul_ext_base); 271 &ul_ext_base);
282 } 272 }
283 DBC_ASSERT(ul_ext_base != 0);
284 if (!ret) { 273 if (!ret) {
285 /* DR OMAPS00013235 : DLModules array may be 274 /* DR OMAPS00013235 : DLModules array may be
286 * in EXTMEM. It is expected that DYNEXTMEM and 275 * in EXTMEM. It is expected that DYNEXTMEM and
@@ -299,7 +288,6 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context,
299 dev_get_symbol 288 dev_get_symbol
300 (dev_context->dev_obj, EXTBASE, 289 (dev_context->dev_obj, EXTBASE,
301 &ul_ext_base); 290 &ul_ext_base);
302 DBC_ASSERT(ul_ext_base != 0);
303 if (!ret) 291 if (!ret)
304 ret = 292 ret =
305 dev_get_symbol 293 dev_get_symbol
@@ -312,15 +300,12 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context,
312 if (trace_load) 300 if (trace_load)
313 ul_ext_base = ul_shm_base_virt; 301 ul_ext_base = ul_shm_base_virt;
314 302
315 DBC_ASSERT(ul_ext_end != 0);
316 DBC_ASSERT(ul_ext_end > ul_ext_base);
317 if (ul_ext_end < ul_ext_base) 303 if (ul_ext_end < ul_ext_base)
318 ret = -EPERM; 304 ret = -EPERM;
319 305
320 if (!ret) { 306 if (!ret) {
321 ul_tlb_base_virt = 307 ul_tlb_base_virt =
322 dev_context->atlb_entry[0].dsp_va * DSPWORDSIZE; 308 dev_context->atlb_entry[0].dsp_va * DSPWORDSIZE;
323 DBC_ASSERT(ul_tlb_base_virt <= ul_shm_base_virt);
324 309
325 if (symbols_reloaded) { 310 if (symbols_reloaded) {
326 ret = dev_get_symbol 311 ret = dev_get_symbol
diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbc.h b/drivers/staging/tidspbridge/include/dspbridge/dbc.h
index dc88f34f166..90c45f69526 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/dbc.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/dbc.h
@@ -25,15 +25,4 @@
25#ifndef DBC_ 25#ifndef DBC_
26#define DBC_ 26#define DBC_
27 27
28/* Assertion Macros: */
29#ifdef CONFIG_TIDSPBRIDGE_DEBUG
30
31#define DBC_ASSERT(exp) \
32 if (!(exp)) \
33 pr_err("%s, line %d: Assertion (" #exp ") failed.\n", \
34 __FILE__, __LINE__)
35#else
36#define DBC_ASSERT(exp) {}
37#endif /* DEBUG */
38
39#endif /* DBC_ */ 28#endif /* DBC_ */
diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c
index 2eeb5370927..0d19bcd4ce2 100644
--- a/drivers/staging/tidspbridge/pmgr/cmm.c
+++ b/drivers/staging/tidspbridge/pmgr/cmm.c
@@ -253,8 +253,6 @@ int cmm_create(struct cmm_object **ph_cmm_mgr,
253 if (mgr_attrts == NULL) 253 if (mgr_attrts == NULL)
254 mgr_attrts = &cmm_dfltmgrattrs; /* set defaults */ 254 mgr_attrts = &cmm_dfltmgrattrs; /* set defaults */
255 255
256 /* 4 bytes minimum */
257 DBC_ASSERT(mgr_attrts->min_block_size >= 4);
258 /* save away smallest block allocation for this cmm mgr */ 256 /* save away smallest block allocation for this cmm mgr */
259 cmm_obj->min_block_size = mgr_attrts->min_block_size; 257 cmm_obj->min_block_size = mgr_attrts->min_block_size;
260 cmm_obj->page_size = PAGE_SIZE; 258 cmm_obj->page_size = PAGE_SIZE;
@@ -849,7 +847,8 @@ int cmm_xlator_free_buf(struct cmm_xlatorobject *xlator, void *buf_va)
849 if (status) { 847 if (status) {
850 /* Uh oh, this shouldn't happen. Descriptor 848 /* Uh oh, this shouldn't happen. Descriptor
851 * gone! */ 849 * gone! */
852 DBC_ASSERT(false); /* CMM is leaking mem */ 850 pr_err("%s, line %d: Assertion failed\n",
851 __FILE__, __LINE__);
853 } 852 }
854 } 853 }
855 } 854 }
@@ -898,7 +897,6 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr,
898 897
899 cmm_mgr_obj = (struct cmm_object *)xlator_obj->cmm_mgr; 898 cmm_mgr_obj = (struct cmm_object *)xlator_obj->cmm_mgr;
900 /* get this translator's default SM allocator */ 899 /* get this translator's default SM allocator */
901 DBC_ASSERT(xlator_obj->seg_id > 0);
902 allocator = cmm_mgr_obj->pa_gppsm_seg_tab[xlator_obj->seg_id - 1]; 900 allocator = cmm_mgr_obj->pa_gppsm_seg_tab[xlator_obj->seg_id - 1];
903 if (!allocator) 901 if (!allocator)
904 goto loop_cont; 902 goto loop_cont;
diff --git a/drivers/staging/tidspbridge/pmgr/dbll.c b/drivers/staging/tidspbridge/pmgr/dbll.c
index db1af795544..997feebbf74 100644
--- a/drivers/staging/tidspbridge/pmgr/dbll.c
+++ b/drivers/staging/tidspbridge/pmgr/dbll.c
@@ -936,9 +936,6 @@ static struct dynload_symbol *dbll_find_symbol(struct dynamic_loader_sym *this,
936 if (!status && gbl_search) 936 if (!status && gbl_search)
937 dev_dbg(bridge, "%s: Symbol not found: %s\n", __func__, name); 937 dev_dbg(bridge, "%s: Symbol not found: %s\n", __func__, name);
938 938
939 DBC_ASSERT((status && (dbll_sym != NULL))
940 || (!status && (dbll_sym == NULL)));
941
942 ret_sym = (struct dynload_symbol *)dbll_sym; 939 ret_sym = (struct dynload_symbol *)dbll_sym;
943 return ret_sym; 940 return ret_sym;
944} 941}
diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c
index e4257fd7ff0..980bd532fb8 100644
--- a/drivers/staging/tidspbridge/pmgr/dev.c
+++ b/drivers/staging/tidspbridge/pmgr/dev.c
@@ -108,7 +108,6 @@ u32 dev_brd_write_fxn(void *arb, u32 dsp_add, void *host_buf,
108 108
109 if (dev_obj) { 109 if (dev_obj) {
110 /* Require of BrdWrite() */ 110 /* Require of BrdWrite() */
111 DBC_ASSERT(dev_obj->bridge_context != NULL);
112 status = (*dev_obj->bridge_interface.brd_write) ( 111 status = (*dev_obj->bridge_interface.brd_write) (
113 dev_obj->bridge_context, host_buf, 112 dev_obj->bridge_context, host_buf,
114 dsp_add, ul_num_bytes, mem_space); 113 dsp_add, ul_num_bytes, mem_space);
@@ -164,7 +163,6 @@ int dev_create_device(struct dev_object **device_obj,
164 /* Create the device object, and pass a handle to the Bridge driver for 163 /* Create the device object, and pass a handle to the Bridge driver for
165 * storage. */ 164 * storage. */
166 if (!status) { 165 if (!status) {
167 DBC_ASSERT(drv_fxns);
168 dev_obj = kzalloc(sizeof(struct dev_object), GFP_KERNEL); 166 dev_obj = kzalloc(sizeof(struct dev_object), GFP_KERNEL);
169 if (dev_obj) { 167 if (dev_obj) {
170 /* Fill out the rest of the Dev Object structure: */ 168 /* Fill out the rest of the Dev Object structure: */
@@ -186,9 +184,6 @@ int dev_create_device(struct dev_object **device_obj,
186 status = (dev_obj->bridge_interface.dev_create) 184 status = (dev_obj->bridge_interface.dev_create)
187 (&dev_obj->bridge_context, dev_obj, 185 (&dev_obj->bridge_context, dev_obj,
188 host_res); 186 host_res);
189 /* Assert bridge_dev_create()'s ensure clause: */
190 DBC_ASSERT(status
191 || (dev_obj->bridge_context != NULL));
192 } else { 187 } else {
193 status = -ENOMEM; 188 status = -ENOMEM;
194 } 189 }
@@ -282,7 +277,6 @@ int dev_create2(struct dev_object *hdev_obj)
282 struct dev_object *dev_obj = hdev_obj; 277 struct dev_object *dev_obj = hdev_obj;
283 278
284 /* There can be only one Node Manager per DEV object */ 279 /* There can be only one Node Manager per DEV object */
285 DBC_ASSERT(!dev_obj->node_mgr);
286 status = node_create_mgr(&dev_obj->node_mgr, hdev_obj); 280 status = node_create_mgr(&dev_obj->node_mgr, hdev_obj);
287 if (status) 281 if (status)
288 dev_obj->node_mgr = NULL; 282 dev_obj->node_mgr = NULL;
diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c
index 792b44363fd..18109fc346a 100644
--- a/drivers/staging/tidspbridge/rmgr/dbdcd.c
+++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c
@@ -206,7 +206,6 @@ int dcd_enumerate_object(s32 index, enum dsp_dcdobjtype obj_type,
206 * "_\0" + length of sz_obj_type string + terminating NULL. 206 * "_\0" + length of sz_obj_type string + terminating NULL.
207 */ 207 */
208 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1; 208 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1;
209 DBC_ASSERT(dw_key_len < DCD_MAXPATHLENGTH);
210 209
211 /* Create proper REG key; concatenate DCD_REGKEY with 210 /* Create proper REG key; concatenate DCD_REGKEY with
212 * obj_type. */ 211 * obj_type. */
@@ -375,7 +374,6 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
375 /* Pre-determine final key length. It's length of DCD_REGKEY + 374 /* Pre-determine final key length. It's length of DCD_REGKEY +
376 * "_\0" + length of sz_obj_type string + terminating NULL */ 375 * "_\0" + length of sz_obj_type string + terminating NULL */
377 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1; 376 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1;
378 DBC_ASSERT(dw_key_len < DCD_MAXPATHLENGTH);
379 377
380 /* Create proper REG key; concatenate DCD_REGKEY with obj_type. */ 378 /* Create proper REG key; concatenate DCD_REGKEY with obj_type. */
381 strncpy(sz_reg_key, DCD_REGKEY, strlen(DCD_REGKEY) + 1); 379 strncpy(sz_reg_key, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
@@ -434,7 +432,6 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
434 } 432 }
435 433
436 /* Ensure sz_uuid + 1 is not greater than sizeof sz_sect_name. */ 434 /* Ensure sz_uuid + 1 is not greater than sizeof sz_sect_name. */
437 DBC_ASSERT((strlen(sz_uuid) + 1) < sizeof(sz_sect_name));
438 435
439 /* Create section name based on node UUID. A period is 436 /* Create section name based on node UUID. A period is
440 * pre-pended to the UUID string to form the section name. 437 * pre-pended to the UUID string to form the section name.
@@ -635,7 +632,6 @@ int dcd_get_library_name(struct dcd_manager *hdcd_mgr,
635 * "_\0" + length of sz_obj_type string + terminating NULL. 632 * "_\0" + length of sz_obj_type string + terminating NULL.
636 */ 633 */
637 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1; 634 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1;
638 DBC_ASSERT(dw_key_len < DCD_MAXPATHLENGTH);
639 635
640 /* Create proper REG key; concatenate DCD_REGKEY with obj_type. */ 636 /* Create proper REG key; concatenate DCD_REGKEY with obj_type. */
641 strncpy(sz_reg_key, DCD_REGKEY, strlen(DCD_REGKEY) + 1); 637 strncpy(sz_reg_key, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
@@ -663,7 +659,6 @@ int dcd_get_library_name(struct dcd_manager *hdcd_mgr,
663 break; 659 break;
664 default: 660 default:
665 status = -EINVAL; 661 status = -EINVAL;
666 DBC_ASSERT(false);
667 } 662 }
668 if (!status) { 663 if (!status) {
669 if ((strlen(sz_reg_key) + strlen(sz_obj_type)) < 664 if ((strlen(sz_reg_key) + strlen(sz_obj_type)) <
@@ -794,7 +789,6 @@ int dcd_register_object(struct dsp_uuid *uuid_obj,
794 * "_\0" + length of sz_obj_type string + terminating NULL. 789 * "_\0" + length of sz_obj_type string + terminating NULL.
795 */ 790 */
796 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1; 791 dw_key_len = strlen(DCD_REGKEY) + 1 + sizeof(sz_obj_type) + 1;
797 DBC_ASSERT(dw_key_len < DCD_MAXPATHLENGTH);
798 792
799 /* Create proper REG key; concatenate DCD_REGKEY with obj_type. */ 793 /* Create proper REG key; concatenate DCD_REGKEY with obj_type. */
800 strncpy(sz_reg_key, DCD_REGKEY, strlen(DCD_REGKEY) + 1); 794 strncpy(sz_reg_key, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c
index 04c88a7d019..63fdf1ee910 100644
--- a/drivers/staging/tidspbridge/rmgr/disp.c
+++ b/drivers/staging/tidspbridge/rmgr/disp.c
@@ -268,7 +268,6 @@ int disp_node_create(struct disp_object *disp_obj,
268 node_type = node_get_type(hnode); 268 node_type = node_get_type(hnode);
269 node_msg_args = pargs->asa.node_msg_args; 269 node_msg_args = pargs->asa.node_msg_args;
270 max = disp_obj->bufsize_rms; /*Max # of RMS words that can be sent */ 270 max = disp_obj->bufsize_rms; /*Max # of RMS words that can be sent */
271 DBC_ASSERT(max == RMS_COMMANDBUFSIZE);
272 chars_in_rms_word = sizeof(rms_word) / disp_obj->char_size; 271 chars_in_rms_word = sizeof(rms_word) / disp_obj->char_size;
273 /* Number of RMS words needed to hold arg data */ 272 /* Number of RMS words needed to hold arg data */
274 dw_length = 273 dw_length =
@@ -429,7 +428,6 @@ int disp_node_create(struct disp_object *disp_obj,
429 } 428 }
430 if (!status) { 429 if (!status) {
431 ul_bytes = total * sizeof(rms_word); 430 ul_bytes = total * sizeof(rms_word);
432 DBC_ASSERT(ul_bytes < (RMS_COMMANDBUFSIZE * sizeof(rms_word)));
433 status = send_message(disp_obj, node_get_timeout(hnode), 431 status = send_message(disp_obj, node_get_timeout(hnode),
434 ul_bytes, node_env); 432 ul_bytes, node_env);
435 } 433 }
@@ -665,7 +663,6 @@ static int send_message(struct disp_object *disp_obj, u32 timeout,
665 status = -EPERM; 663 status = -EPERM;
666 } else { 664 } else {
667 if (CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) { 665 if (CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) {
668 DBC_ASSERT(chnl_ioc_obj.buf == pbuf);
669 if (*((int *)chnl_ioc_obj.buf) < 0) { 666 if (*((int *)chnl_ioc_obj.buf) < 0) {
670 /* Translate DSP's to kernel error */ 667 /* Translate DSP's to kernel error */
671 status = -EREMOTEIO; 668 status = -EREMOTEIO;
diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c
index f3bff1bfcc6..cd93c128570 100644
--- a/drivers/staging/tidspbridge/rmgr/drv.c
+++ b/drivers/staging/tidspbridge/rmgr/drv.c
@@ -172,7 +172,6 @@ void drv_proc_node_update_status(void *node_resource, s32 status)
172{ 172{
173 struct node_res_object *node_res_obj = 173 struct node_res_object *node_res_obj =
174 (struct node_res_object *)node_resource; 174 (struct node_res_object *)node_resource;
175 DBC_ASSERT(node_resource != NULL);
176 node_res_obj->node_allocated = status; 175 node_res_obj->node_allocated = status;
177} 176}
178 177
@@ -181,7 +180,6 @@ void drv_proc_node_update_heap_status(void *node_resource, s32 status)
181{ 180{
182 struct node_res_object *node_res_obj = 181 struct node_res_object *node_res_obj =
183 (struct node_res_object *)node_resource; 182 (struct node_res_object *)node_resource;
184 DBC_ASSERT(node_resource != NULL);
185 node_res_obj->heap_allocated = status; 183 node_res_obj->heap_allocated = status;
186} 184}
187 185
@@ -378,13 +376,8 @@ int drv_get_dev_object(u32 index, struct drv_object *hdrv_obj,
378 struct dev_object **device_obj) 376 struct dev_object **device_obj)
379{ 377{
380 int status = 0; 378 int status = 0;
381#ifdef CONFIG_TIDSPBRIDGE_DEBUG
382 /* used only for Assertions and debug messages */
383 struct drv_object *pdrv_obj = (struct drv_object *)hdrv_obj;
384#endif
385 struct dev_object *dev_obj; 379 struct dev_object *dev_obj;
386 u32 i; 380 u32 i;
387 DBC_ASSERT(!(list_empty(&pdrv_obj->dev_list)));
388 381
389 dev_obj = (struct dev_object *)drv_get_first_dev_object(); 382 dev_obj = (struct dev_object *)drv_get_first_dev_object();
390 for (i = 0; i < index; i++) { 383 for (i = 0; i < index; i++) {
diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c
index 34730de45aa..f0f07efe4f8 100644
--- a/drivers/staging/tidspbridge/rmgr/drv_interface.c
+++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c
@@ -255,8 +255,6 @@ static int bridge_mmap(struct file *filp, struct vm_area_struct *vma)
255{ 255{
256 u32 status; 256 u32 status;
257 257
258 DBC_ASSERT(vma->vm_start < vma->vm_end);
259
260 vma->vm_flags |= VM_RESERVED | VM_IO; 258 vma->vm_flags |= VM_RESERVED | VM_IO;
261 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 259 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
262 260
diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c b/drivers/staging/tidspbridge/rmgr/mgr.c
index 1dca953e4d6..b0ce0bc9c81 100644
--- a/drivers/staging/tidspbridge/rmgr/mgr.c
+++ b/drivers/staging/tidspbridge/rmgr/mgr.c
@@ -141,7 +141,6 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props,
141 } 141 }
142 pmgr_obj = drv_datap->mgr_object; 142 pmgr_obj = drv_datap->mgr_object;
143 143
144 DBC_ASSERT(pmgr_obj);
145 /* Forever loop till we hit failed or no more items in the 144 /* Forever loop till we hit failed or no more items in the
146 * Enumeration. We will exit the loop other than 0; */ 145 * Enumeration. We will exit the loop other than 0; */
147 while (!status) { 146 while (!status) {
@@ -225,7 +224,6 @@ int mgr_enum_processor_info(u32 processor_id,
225 dev_dbg(bridge, "%s: Failed to get MGR Object\n", __func__); 224 dev_dbg(bridge, "%s: Failed to get MGR Object\n", __func__);
226 goto func_end; 225 goto func_end;
227 } 226 }
228 DBC_ASSERT(pmgr_obj);
229 /* Forever loop till we hit no more items in the 227 /* Forever loop till we hit no more items in the
230 * Enumeration. We will exit the loop other than 0; */ 228 * Enumeration. We will exit the loop other than 0; */
231 while (status1 == 0) { 229 while (status1 == 0) {
diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c
index 6fb19ef68a8..cc20dd9bcbe 100644
--- a/drivers/staging/tidspbridge/rmgr/nldr.c
+++ b/drivers/staging/tidspbridge/rmgr/nldr.c
@@ -427,13 +427,10 @@ int nldr_create(struct nldr_object **nldr,
427 dev_get_cod_mgr(hdev_obj, &cod_mgr); 427 dev_get_cod_mgr(hdev_obj, &cod_mgr);
428 if (cod_mgr) { 428 if (cod_mgr) {
429 status = cod_get_loader(cod_mgr, &nldr_obj->dbll); 429 status = cod_get_loader(cod_mgr, &nldr_obj->dbll);
430 DBC_ASSERT(!status);
431 status = cod_get_base_lib(cod_mgr, &nldr_obj->base_lib); 430 status = cod_get_base_lib(cod_mgr, &nldr_obj->base_lib);
432 DBC_ASSERT(!status);
433 status = 431 status =
434 cod_get_base_name(cod_mgr, sz_zl_file, 432 cod_get_base_name(cod_mgr, sz_zl_file,
435 COD_MAXPATHLENGTH); 433 COD_MAXPATHLENGTH);
436 DBC_ASSERT(!status);
437 } 434 }
438 status = 0; 435 status = 0;
439 /* end lazy status checking */ 436 /* end lazy status checking */
@@ -534,7 +531,6 @@ int nldr_create(struct nldr_object **nldr,
534 status = 531 status =
535 cod_get_base_name(cod_mgr, sz_zl_file, COD_MAXPATHLENGTH); 532 cod_get_base_name(cod_mgr, sz_zl_file, COD_MAXPATHLENGTH);
536 /* lazy check */ 533 /* lazy check */
537 DBC_ASSERT(!status);
538 /* First count number of overlay nodes */ 534 /* First count number of overlay nodes */
539 status = 535 status =
540 dcd_get_objects(nldr_obj->dcd_mgr, sz_zl_file, 536 dcd_get_objects(nldr_obj->dcd_mgr, sz_zl_file,
@@ -666,7 +662,6 @@ int nldr_get_fxn_addr(struct nldr_nodeobject *nldr_node_obj,
666 root = nldr_node_obj->delete_lib; 662 root = nldr_node_obj->delete_lib;
667 break; 663 break;
668 default: 664 default:
669 DBC_ASSERT(false);
670 break; 665 break;
671 } 666 }
672 } else { 667 } else {
@@ -806,7 +801,6 @@ int nldr_load(struct nldr_nodeobject *nldr_node_obj,
806 break; 801 break;
807 802
808 default: 803 default:
809 DBC_ASSERT(false);
810 break; 804 break;
811 } 805 }
812 } 806 }
@@ -853,7 +847,6 @@ int nldr_unload(struct nldr_nodeobject *nldr_node_obj,
853 nldr_node_obj->pers_libs = 0; 847 nldr_node_obj->pers_libs = 0;
854 break; 848 break;
855 default: 849 default:
856 DBC_ASSERT(false);
857 break; 850 break;
858 } 851 }
859 } else { 852 } else {
@@ -1090,7 +1083,6 @@ static void free_sects(struct nldr_object *nldr_obj,
1090 ret = 1083 ret =
1091 rmm_free(nldr_obj->rmm, 0, ovly_section->sect_run_addr, 1084 rmm_free(nldr_obj->rmm, 0, ovly_section->sect_run_addr,
1092 ovly_section->size, true); 1085 ovly_section->size, true);
1093 DBC_ASSERT(ret);
1094 ovly_section = ovly_section->next_sect; 1086 ovly_section = ovly_section->next_sect;
1095 i++; 1087 i++;
1096 } 1088 }
@@ -1210,7 +1202,6 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj,
1210 1202
1211 if (depth > MAXDEPTH) { 1203 if (depth > MAXDEPTH) {
1212 /* Error */ 1204 /* Error */
1213 DBC_ASSERT(false);
1214 } 1205 }
1215 root->lib = NULL; 1206 root->lib = NULL;
1216 /* Allocate a buffer for library file name of size DBL_MAXPATHLENGTH */ 1207 /* Allocate a buffer for library file name of size DBL_MAXPATHLENGTH */
@@ -1273,7 +1264,6 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj,
1273 dcd_get_num_dep_libs(nldr_node_obj->nldr_obj->dcd_mgr, 1264 dcd_get_num_dep_libs(nldr_node_obj->nldr_obj->dcd_mgr,
1274 &uuid, &nd_libs, &np_libs, phase); 1265 &uuid, &nd_libs, &np_libs, phase);
1275 } 1266 }
1276 DBC_ASSERT(nd_libs >= np_libs);
1277 if (!status) { 1267 if (!status) {
1278 if (!(*nldr_node_obj->phase_split)) 1268 if (!(*nldr_node_obj->phase_split))
1279 np_libs = 0; 1269 np_libs = 0;
@@ -1435,7 +1425,6 @@ static int load_ovly(struct nldr_nodeobject *nldr_node_obj,
1435 } 1425 }
1436 } 1426 }
1437 1427
1438 DBC_ASSERT(i < nldr_obj->ovly_nodes);
1439 1428
1440 if (!po_node) { 1429 if (!po_node) {
1441 status = -ENOENT; 1430 status = -ENOENT;
@@ -1461,7 +1450,6 @@ static int load_ovly(struct nldr_nodeobject *nldr_node_obj,
1461 break; 1450 break;
1462 1451
1463 default: 1452 default:
1464 DBC_ASSERT(false);
1465 break; 1453 break;
1466 } 1454 }
1467 1455
@@ -1609,7 +1597,6 @@ static int remote_alloc(void **ref, u16 mem_sect, u32 size,
1609 mem_phase_bit = EXECUTEDATAFLAGBIT; 1597 mem_phase_bit = EXECUTEDATAFLAGBIT;
1610 break; 1598 break;
1611 default: 1599 default:
1612 DBC_ASSERT(false);
1613 break; 1600 break;
1614 } 1601 }
1615 if (mem_sect == DBLL_CODE) 1602 if (mem_sect == DBLL_CODE)
@@ -1628,11 +1615,9 @@ static int remote_alloc(void **ref, u16 mem_sect, u32 size,
1628 /* Find an appropriate segment based on mem_sect */ 1615 /* Find an appropriate segment based on mem_sect */
1629 if (segid == NULLID) { 1616 if (segid == NULLID) {
1630 /* No memory requirements of preferences */ 1617 /* No memory requirements of preferences */
1631 DBC_ASSERT(!mem_load_req);
1632 goto func_cont; 1618 goto func_cont;
1633 } 1619 }
1634 if (segid <= MAXSEGID) { 1620 if (segid <= MAXSEGID) {
1635 DBC_ASSERT(segid < nldr_obj->dload_segs);
1636 /* Attempt to allocate from segid first. */ 1621 /* Attempt to allocate from segid first. */
1637 rmm_addr_obj->segid = segid; 1622 rmm_addr_obj->segid = segid;
1638 status = 1623 status =
@@ -1643,7 +1628,6 @@ static int remote_alloc(void **ref, u16 mem_sect, u32 size,
1643 } 1628 }
1644 } else { 1629 } else {
1645 /* segid > MAXSEGID ==> Internal or external memory */ 1630 /* segid > MAXSEGID ==> Internal or external memory */
1646 DBC_ASSERT(segid == MEMINTERNALID || segid == MEMEXTERNALID);
1647 /* Check for any internal or external memory segment, 1631 /* Check for any internal or external memory segment,
1648 * depending on segid. */ 1632 * depending on segid. */
1649 mem_sect_type |= segid == MEMINTERNALID ? 1633 mem_sect_type |= segid == MEMINTERNALID ?
@@ -1717,7 +1701,6 @@ static void unload_lib(struct nldr_nodeobject *nldr_node_obj,
1717 struct nldr_object *nldr_obj = nldr_node_obj->nldr_obj; 1701 struct nldr_object *nldr_obj = nldr_node_obj->nldr_obj;
1718 u16 i; 1702 u16 i;
1719 1703
1720 DBC_ASSERT(root != NULL);
1721 1704
1722 /* Unload dependent libraries */ 1705 /* Unload dependent libraries */
1723 for (i = 0; i < root->dep_libs; i++) 1706 for (i = 0; i < root->dep_libs; i++)
@@ -1768,7 +1751,6 @@ static void unload_ovly(struct nldr_nodeobject *nldr_node_obj,
1768 } 1751 }
1769 } 1752 }
1770 1753
1771 DBC_ASSERT(i < nldr_obj->ovly_nodes);
1772 1754
1773 if (!po_node) 1755 if (!po_node)
1774 /* TODO: Should we print warning here? */ 1756 /* TODO: Should we print warning here? */
@@ -1795,14 +1777,11 @@ static void unload_ovly(struct nldr_nodeobject *nldr_node_obj,
1795 other_alloc = po_node->other_sects; 1777 other_alloc = po_node->other_sects;
1796 break; 1778 break;
1797 default: 1779 default:
1798 DBC_ASSERT(false);
1799 break; 1780 break;
1800 } 1781 }
1801 DBC_ASSERT(ref_count && (*ref_count > 0));
1802 if (ref_count && (*ref_count > 0)) { 1782 if (ref_count && (*ref_count > 0)) {
1803 *ref_count -= 1; 1783 *ref_count -= 1;
1804 if (other_ref) { 1784 if (other_ref) {
1805 DBC_ASSERT(*other_ref > 0);
1806 *other_ref -= 1; 1785 *other_ref -= 1;
1807 } 1786 }
1808 } 1787 }
@@ -1868,7 +1847,6 @@ int nldr_find_addr(struct nldr_nodeobject *nldr_node, u32 sym_addr,
1868 root = nldr_node->delete_lib; 1847 root = nldr_node->delete_lib;
1869 break; 1848 break;
1870 default: 1849 default:
1871 DBC_ASSERT(false);
1872 break; 1850 break;
1873 } 1851 }
1874 } else { 1852 } else {
diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c
index d23d1d07d67..83b053f6be8 100644
--- a/drivers/staging/tidspbridge/rmgr/node.c
+++ b/drivers/staging/tidspbridge/rmgr/node.c
@@ -703,7 +703,6 @@ DBAPI node_alloc_msg_buf(struct node_object *hnode, u32 usize,
703 703
704 status = proc_get_processor_id(pnode->processor, &proc_id); 704 status = proc_get_processor_id(pnode->processor, &proc_id);
705 if (proc_id != DSP_UNIT) { 705 if (proc_id != DSP_UNIT) {
706 DBC_ASSERT(NULL);
707 goto func_end; 706 goto func_end;
708 } 707 }
709 /* If segment ID includes MEM_SETVIRTUALSEGID then pbuffer is a 708 /* If segment ID includes MEM_SETVIRTUALSEGID then pbuffer is a
@@ -889,7 +888,6 @@ int node_connect(struct node_object *node1, u32 stream1,
889 if (node1_type != NODE_GPP) { 888 if (node1_type != NODE_GPP) {
890 hnode_mgr = node1->node_mgr; 889 hnode_mgr = node1->node_mgr;
891 } else { 890 } else {
892 DBC_ASSERT(node2 != (struct node_object *)DSP_HGPPNODE);
893 hnode_mgr = node2->node_mgr; 891 hnode_mgr = node2->node_mgr;
894 } 892 }
895 893
@@ -968,9 +966,6 @@ int node_connect(struct node_object *node1, u32 stream1,
968 goto out_unlock; 966 goto out_unlock;
969 } 967 }
970 968
971 DBC_ASSERT((node1_type == NODE_GPP) ||
972 (node2_type == NODE_GPP));
973
974 chnl_mode = (node1_type == NODE_GPP) ? 969 chnl_mode = (node1_type == NODE_GPP) ?
975 CHNL_MODETODSP : CHNL_MODEFROMDSP; 970 CHNL_MODETODSP : CHNL_MODEFROMDSP;
976 971
@@ -1617,7 +1612,6 @@ int node_free_msg_buf(struct node_object *hnode, u8 * pbuffer,
1617 status = cmm_xlator_free_buf(pnode->xlator, pbuffer); 1612 status = cmm_xlator_free_buf(pnode->xlator, pbuffer);
1618 } 1613 }
1619 } else { 1614 } else {
1620 DBC_ASSERT(NULL); /* BUG */
1621 } 1615 }
1622func_end: 1616func_end:
1623 return status; 1617 return status;
@@ -1692,7 +1686,6 @@ int node_get_channel_id(struct node_object *hnode, u32 dir, u32 index,
1692 } 1686 }
1693 } 1687 }
1694 } else { 1688 } else {
1695 DBC_ASSERT(dir == DSP_FROMNODE);
1696 if (index < MAX_OUTPUTS(hnode)) { 1689 if (index < MAX_OUTPUTS(hnode)) {
1697 if (hnode->outputs[index].type == HOSTCONNECT) { 1690 if (hnode->outputs[index].type == HOSTCONNECT) {
1698 *chan_id = hnode->outputs[index].dev_id; 1691 *chan_id = hnode->outputs[index].dev_id;
@@ -2222,7 +2215,6 @@ int node_run(struct node_object *hnode)
2222 NODE_GET_PRIORITY(hnode)); 2215 NODE_GET_PRIORITY(hnode));
2223 } else { 2216 } else {
2224 /* We should never get here */ 2217 /* We should never get here */
2225 DBC_ASSERT(false);
2226 } 2218 }
2227func_cont1: 2219func_cont1:
2228 /* Update node state. */ 2220 /* Update node state. */
@@ -2600,7 +2592,6 @@ static void fill_stream_connect(struct node_object *node1,
2600 strm1->connect_type = CONNECTTYPE_GPPOUTPUT; 2592 strm1->connect_type = CONNECTTYPE_GPPOUTPUT;
2601 } else { 2593 } else {
2602 /* GPP == > NODE */ 2594 /* GPP == > NODE */
2603 DBC_ASSERT(node2 != (struct node_object *)DSP_HGPPNODE);
2604 strm_index = node2->num_inputs + node2->num_outputs - 1; 2595 strm_index = node2->num_inputs + node2->num_outputs - 1;
2605 strm2 = &(node2->stream_connect[strm_index]); 2596 strm2 = &(node2->stream_connect[strm_index]);
2606 strm2->cb_struct = sizeof(struct dsp_streamconnect); 2597 strm2->cb_struct = sizeof(struct dsp_streamconnect);
@@ -2696,7 +2687,6 @@ static int get_fxn_address(struct node_object *hnode, u32 * fxn_addr,
2696 break; 2687 break;
2697 default: 2688 default:
2698 /* Should never get here */ 2689 /* Should never get here */
2699 DBC_ASSERT(false);
2700 break; 2690 break;
2701 } 2691 }
2702 2692
@@ -2775,7 +2765,6 @@ static int get_node_props(struct dcd_manager *hdcd_mgr,
2775 } else { 2765 } else {
2776 /* Copy device name */ 2766 /* Copy device name */
2777 len = strlen(pndb_props->ac_name); 2767 len = strlen(pndb_props->ac_name);
2778 DBC_ASSERT(len < MAXDEVNAMELEN);
2779 hnode->str_dev_name = kzalloc(len + 1, GFP_KERNEL); 2768 hnode->str_dev_name = kzalloc(len + 1, GFP_KERNEL);
2780 if (hnode->str_dev_name == NULL) { 2769 if (hnode->str_dev_name == NULL) {
2781 status = -ENOMEM; 2770 status = -ENOMEM;
diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c
index 4e2f2e450b2..8da5db6fe07 100644
--- a/drivers/staging/tidspbridge/rmgr/proc.c
+++ b/drivers/staging/tidspbridge/rmgr/proc.c
@@ -1152,8 +1152,6 @@ int proc_load(void *hprocessor, const s32 argc_index,
1152 if (status) { 1152 if (status) {
1153 status = -EPERM; 1153 status = -EPERM;
1154 } else { 1154 } else {
1155 DBC_ASSERT(p_proc_object->last_coff ==
1156 NULL);
1157 /* Allocate memory for pszLastCoff */ 1155 /* Allocate memory for pszLastCoff */
1158 p_proc_object->last_coff = 1156 p_proc_object->last_coff =
1159 kzalloc((strlen(user_args[0]) + 1157 kzalloc((strlen(user_args[0]) +
@@ -1176,7 +1174,6 @@ int proc_load(void *hprocessor, const s32 argc_index,
1176 if (!hmsg_mgr) { 1174 if (!hmsg_mgr) {
1177 status = msg_create(&hmsg_mgr, p_proc_object->dev_obj, 1175 status = msg_create(&hmsg_mgr, p_proc_object->dev_obj,
1178 (msg_onexit) node_on_exit); 1176 (msg_onexit) node_on_exit);
1179 DBC_ASSERT(!status);
1180 dev_set_msg_mgr(p_proc_object->dev_obj, hmsg_mgr); 1177 dev_set_msg_mgr(p_proc_object->dev_obj, hmsg_mgr);
1181 } 1178 }
1182 } 1179 }
@@ -1272,7 +1269,6 @@ int proc_load(void *hprocessor, const s32 argc_index,
1272 strlen(pargv0) + 1); 1269 strlen(pargv0) + 1);
1273 else 1270 else
1274 status = -ENOMEM; 1271 status = -ENOMEM;
1275 DBC_ASSERT(brd_state == BRD_LOADED);
1276 } 1272 }
1277 } 1273 }
1278 1274
@@ -1559,7 +1555,6 @@ func_cont:
1559 if (!((*p_proc_object->intf_fxns->brd_status) 1555 if (!((*p_proc_object->intf_fxns->brd_status)
1560 (p_proc_object->bridge_context, &brd_state))) { 1556 (p_proc_object->bridge_context, &brd_state))) {
1561 pr_info("%s: dsp in running state\n", __func__); 1557 pr_info("%s: dsp in running state\n", __func__);
1562 DBC_ASSERT(brd_state != BRD_HIBERNATION);
1563 } 1558 }
1564 } else { 1559 } else {
1565 pr_err("%s: Failed to start the dsp\n", __func__); 1560 pr_err("%s: Failed to start the dsp\n", __func__);
@@ -1585,7 +1580,6 @@ int proc_stop(void *hprocessor)
1585 u32 node_tab_size = 1; 1580 u32 node_tab_size = 1;
1586 u32 num_nodes = 0; 1581 u32 num_nodes = 0;
1587 u32 nodes_allocated = 0; 1582 u32 nodes_allocated = 0;
1588 int brd_state;
1589 1583
1590 if (!p_proc_object) { 1584 if (!p_proc_object) {
1591 status = -EFAULT; 1585 status = -EFAULT;
@@ -1618,11 +1612,6 @@ int proc_stop(void *hprocessor)
1618 msg_delete(hmsg_mgr); 1612 msg_delete(hmsg_mgr);
1619 dev_set_msg_mgr(p_proc_object->dev_obj, NULL); 1613 dev_set_msg_mgr(p_proc_object->dev_obj, NULL);
1620 } 1614 }
1621 if (!((*p_proc_object->
1622 intf_fxns->brd_status) (p_proc_object->
1623 bridge_context,
1624 &brd_state)))
1625 DBC_ASSERT(brd_state == BRD_STOPPED);
1626 } 1615 }
1627 } else { 1616 } else {
1628 pr_err("%s: Failed to stop the processor\n", __func__); 1617 pr_err("%s: Failed to stop the processor\n", __func__);
@@ -1760,7 +1749,6 @@ static int proc_monitor(struct proc_object *proc_obj)
1760{ 1749{
1761 int status = -EPERM; 1750 int status = -EPERM;
1762 struct msg_mgr *hmsg_mgr; 1751 struct msg_mgr *hmsg_mgr;
1763 int brd_state;
1764 1752
1765 /* This is needed only when Device is loaded when it is 1753 /* This is needed only when Device is loaded when it is
1766 * already 'ACTIVE' */ 1754 * already 'ACTIVE' */
@@ -1777,9 +1765,6 @@ static int proc_monitor(struct proc_object *proc_obj)
1777 if (!((*proc_obj->intf_fxns->brd_monitor) 1765 if (!((*proc_obj->intf_fxns->brd_monitor)
1778 (proc_obj->bridge_context))) { 1766 (proc_obj->bridge_context))) {
1779 status = 0; 1767 status = 0;
1780 if (!((*proc_obj->intf_fxns->brd_status)
1781 (proc_obj->bridge_context, &brd_state)))
1782 DBC_ASSERT(brd_state == BRD_IDLE);
1783 } 1768 }
1784 1769
1785 return status; 1770 return status;
diff --git a/drivers/staging/tidspbridge/rmgr/rmm.c b/drivers/staging/tidspbridge/rmgr/rmm.c
index 6b410499c3b..fe13a7444ae 100644
--- a/drivers/staging/tidspbridge/rmgr/rmm.c
+++ b/drivers/staging/tidspbridge/rmgr/rmm.c
@@ -292,7 +292,6 @@ bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 dsp_addr, u32 size,
292 list_for_each_entry_safe(sect, tmp, &target->ovly_list, 292 list_for_each_entry_safe(sect, tmp, &target->ovly_list,
293 list_elem) { 293 list_elem) {
294 if (dsp_addr == sect->addr) { 294 if (dsp_addr == sect->addr) {
295 DBC_ASSERT(size == sect->size);
296 /* Remove from list */ 295 /* Remove from list */
297 list_del(&sect->list_elem); 296 list_del(&sect->list_elem);
298 kfree(sect); 297 kfree(sect);
@@ -325,8 +324,6 @@ bool rmm_stat(struct rmm_target_obj *target, enum dsp_memtype segid,
325 u32 total_free_size = 0; 324 u32 total_free_size = 0;
326 u32 free_blocks = 0; 325 u32 free_blocks = 0;
327 326
328 DBC_ASSERT(target != NULL);
329
330 if ((u32) segid < target->num_segs) { 327 if ((u32) segid < target->num_segs) {
331 head = target->free_list[segid]; 328 head = target->free_list[segid];
332 329
diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c
index 8e2d6493344..80d01e5b053 100644
--- a/drivers/staging/tidspbridge/rmgr/strm.c
+++ b/drivers/staging/tidspbridge/rmgr/strm.c
@@ -119,7 +119,6 @@ int strm_allocate_buffer(struct strm_res_object *strmres, u32 usize,
119 goto func_end; 119 goto func_end;
120 120
121 for (i = 0; i < num_bufs; i++) { 121 for (i = 0; i < num_bufs; i++) {
122 DBC_ASSERT(stream_obj->xlator != NULL);
123 (void)cmm_xlator_alloc_buf(stream_obj->xlator, &ap_buffer[i], 122 (void)cmm_xlator_alloc_buf(stream_obj->xlator, &ap_buffer[i],
124 usize); 123 usize);
125 if (ap_buffer[i] == NULL) { 124 if (ap_buffer[i] == NULL) {
@@ -162,7 +161,6 @@ int strm_close(struct strm_res_object *strmres,
162 status = 161 status =
163 (*intf_fxns->chnl_get_info) (stream_obj->chnl_obj, 162 (*intf_fxns->chnl_get_info) (stream_obj->chnl_obj,
164 &chnl_info_obj); 163 &chnl_info_obj);
165 DBC_ASSERT(!status);
166 164
167 if (chnl_info_obj.cio_cs > 0 || chnl_info_obj.cio_reqs > 0) 165 if (chnl_info_obj.cio_cs > 0 || chnl_info_obj.cio_reqs > 0)
168 status = -EPIPE; 166 status = -EPIPE;
@@ -205,7 +203,6 @@ int strm_create(struct strm_mgr **strm_man,
205 if (!status) { 203 if (!status) {
206 (void)dev_get_intf_fxns(dev_obj, 204 (void)dev_get_intf_fxns(dev_obj,
207 &(strm_mgr_obj->intf_fxns)); 205 &(strm_mgr_obj->intf_fxns));
208 DBC_ASSERT(strm_mgr_obj->intf_fxns != NULL);
209 } 206 }
210 } 207 }
211 208
@@ -254,7 +251,6 @@ int strm_free_buffer(struct strm_res_object *strmres, u8 ** ap_buffer,
254 251
255 if (!status) { 252 if (!status) {
256 for (i = 0; i < num_bufs; i++) { 253 for (i = 0; i < num_bufs; i++) {
257 DBC_ASSERT(stream_obj->xlator != NULL);
258 status = 254 status =
259 cmm_xlator_free_buf(stream_obj->xlator, 255 cmm_xlator_free_buf(stream_obj->xlator,
260 ap_buffer[i]); 256 ap_buffer[i]);
@@ -302,7 +298,6 @@ int strm_get_info(struct strm_object *stream_obj,
302 298
303 if (stream_obj->xlator) { 299 if (stream_obj->xlator) {
304 /* We have a translator */ 300 /* We have a translator */
305 DBC_ASSERT(stream_obj->segment_id > 0);
306 cmm_xlator_info(stream_obj->xlator, (u8 **) &virt_base, 0, 301 cmm_xlator_info(stream_obj->xlator, (u8 **) &virt_base, 0,
307 stream_obj->segment_id, false); 302 stream_obj->segment_id, false);
308 } 303 }
@@ -496,14 +491,12 @@ int strm_open(struct node_object *hnode, u32 dir, u32 index,
496 goto func_cont; 491 goto func_cont;
497 492
498 /* No System DMA */ 493 /* No System DMA */
499 DBC_ASSERT(strm_obj->strm_mode != STRMMODE_LDMA);
500 /* Get the shared mem mgr for this streams dev object */ 494 /* Get the shared mem mgr for this streams dev object */
501 status = dev_get_cmm_mgr(strm_mgr_obj->dev_obj, &hcmm_mgr); 495 status = dev_get_cmm_mgr(strm_mgr_obj->dev_obj, &hcmm_mgr);
502 if (!status) { 496 if (!status) {
503 /*Allocate a SM addr translator for this strm. */ 497 /*Allocate a SM addr translator for this strm. */
504 status = cmm_xlator_create(&strm_obj->xlator, hcmm_mgr, NULL); 498 status = cmm_xlator_create(&strm_obj->xlator, hcmm_mgr, NULL);
505 if (!status) { 499 if (!status) {
506 DBC_ASSERT(strm_obj->segment_id > 0);
507 /* Set translators Virt Addr attributes */ 500 /* Set translators Virt Addr attributes */
508 status = cmm_xlator_info(strm_obj->xlator, 501 status = cmm_xlator_info(strm_obj->xlator,
509 (u8 **) &pattr->virt_base, 502 (u8 **) &pattr->virt_base,
@@ -535,10 +528,6 @@ func_cont:
535 * strm_mgr_obj->chnl_mgr better be valid or we 528 * strm_mgr_obj->chnl_mgr better be valid or we
536 * assert here), and then return -EPERM. 529 * assert here), and then return -EPERM.
537 */ 530 */
538 DBC_ASSERT(status == -ENOSR ||
539 status == -ECHRNG ||
540 status == -EALREADY ||
541 status == -EIO);
542 status = -EPERM; 531 status = -EPERM;
543 } 532 }
544 } 533 }