aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/tidspbridge/rmgr/dbdcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/tidspbridge/rmgr/dbdcd.c')
-rw-r--r--drivers/staging/tidspbridge/rmgr/dbdcd.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c
index fda240214cd..792b44363fd 100644
--- a/drivers/staging/tidspbridge/rmgr/dbdcd.c
+++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c
@@ -85,8 +85,6 @@ int dcd_auto_register(struct dcd_manager *hdcd_mgr,
85{ 85{
86 int status = 0; 86 int status = 0;
87 87
88 DBC_REQUIRE(refs > 0);
89
90 if (hdcd_mgr) 88 if (hdcd_mgr)
91 status = dcd_get_objects(hdcd_mgr, sz_coff_path, 89 status = dcd_get_objects(hdcd_mgr, sz_coff_path,
92 (dcd_registerfxn) dcd_register_object, 90 (dcd_registerfxn) dcd_register_object,
@@ -107,8 +105,6 @@ int dcd_auto_unregister(struct dcd_manager *hdcd_mgr,
107{ 105{
108 int status = 0; 106 int status = 0;
109 107
110 DBC_REQUIRE(refs > 0);
111
112 if (hdcd_mgr) 108 if (hdcd_mgr)
113 status = dcd_get_objects(hdcd_mgr, sz_coff_path, 109 status = dcd_get_objects(hdcd_mgr, sz_coff_path,
114 (dcd_registerfxn) dcd_register_object, 110 (dcd_registerfxn) dcd_register_object,
@@ -131,9 +127,6 @@ int dcd_create_manager(char *sz_zl_dll_name,
131 struct dcd_manager *dcd_mgr_obj = NULL; /* DCD Manager pointer */ 127 struct dcd_manager *dcd_mgr_obj = NULL; /* DCD Manager pointer */
132 int status = 0; 128 int status = 0;
133 129
134 DBC_REQUIRE(refs >= 0);
135 DBC_REQUIRE(dcd_mgr);
136
137 status = cod_create(&cod_mgr, sz_zl_dll_name); 130 status = cod_create(&cod_mgr, sz_zl_dll_name);
138 if (status) 131 if (status)
139 goto func_end; 132 goto func_end;
@@ -156,9 +149,6 @@ int dcd_create_manager(char *sz_zl_dll_name,
156 cod_delete(cod_mgr); 149 cod_delete(cod_mgr);
157 } 150 }
158 151
159 DBC_ENSURE((!status) ||
160 ((dcd_mgr_obj == NULL) && (status == -ENOMEM)));
161
162func_end: 152func_end:
163 return status; 153 return status;
164} 154}
@@ -173,8 +163,6 @@ int dcd_destroy_manager(struct dcd_manager *hdcd_mgr)
173 struct dcd_manager *dcd_mgr_obj = hdcd_mgr; 163 struct dcd_manager *dcd_mgr_obj = hdcd_mgr;
174 int status = -EFAULT; 164 int status = -EFAULT;
175 165
176 DBC_REQUIRE(refs >= 0);
177
178 if (hdcd_mgr) { 166 if (hdcd_mgr) {
179 /* Delete the COD manager. */ 167 /* Delete the COD manager. */
180 cod_delete(dcd_mgr_obj->cod_mgr); 168 cod_delete(dcd_mgr_obj->cod_mgr);
@@ -205,10 +193,6 @@ int dcd_enumerate_object(s32 index, enum dsp_dcdobjtype obj_type,
205 struct dcd_key_elem *dcd_key; 193 struct dcd_key_elem *dcd_key;
206 int len; 194 int len;
207 195
208 DBC_REQUIRE(refs >= 0);
209 DBC_REQUIRE(index >= 0);
210 DBC_REQUIRE(uuid_obj != NULL);
211
212 if ((index != 0) && (enum_refs == 0)) { 196 if ((index != 0) && (enum_refs == 0)) {
213 /* 197 /*
214 * If an enumeration is being performed on an index greater 198 * If an enumeration is being performed on an index greater
@@ -294,8 +278,6 @@ int dcd_enumerate_object(s32 index, enum dsp_dcdobjtype obj_type,
294 } 278 }
295 } 279 }
296 280
297 DBC_ENSURE(uuid_obj || (status == -EPERM));
298
299 return status; 281 return status;
300} 282}
301 283
@@ -307,7 +289,6 @@ int dcd_enumerate_object(s32 index, enum dsp_dcdobjtype obj_type,
307void dcd_exit(void) 289void dcd_exit(void)
308{ 290{
309 struct dcd_key_elem *rv, *rv_tmp; 291 struct dcd_key_elem *rv, *rv_tmp;
310 DBC_REQUIRE(refs > 0);
311 292
312 refs--; 293 refs--;
313 if (refs == 0) { 294 if (refs == 0) {
@@ -319,7 +300,6 @@ void dcd_exit(void)
319 } 300 }
320 } 301 }
321 302
322 DBC_ENSURE(refs >= 0);
323} 303}
324 304
325/* 305/*
@@ -333,12 +313,6 @@ int dcd_get_dep_libs(struct dcd_manager *hdcd_mgr,
333{ 313{
334 int status = 0; 314 int status = 0;
335 315
336 DBC_REQUIRE(refs > 0);
337 DBC_REQUIRE(hdcd_mgr);
338 DBC_REQUIRE(uuid_obj != NULL);
339 DBC_REQUIRE(dep_lib_uuids != NULL);
340 DBC_REQUIRE(prstnt_dep_libs != NULL);
341
342 status = 316 status =
343 get_dep_lib_info(hdcd_mgr, uuid_obj, &num_libs, NULL, dep_lib_uuids, 317 get_dep_lib_info(hdcd_mgr, uuid_obj, &num_libs, NULL, dep_lib_uuids,
344 prstnt_dep_libs, phase); 318 prstnt_dep_libs, phase);
@@ -356,12 +330,6 @@ int dcd_get_num_dep_libs(struct dcd_manager *hdcd_mgr,
356{ 330{
357 int status = 0; 331 int status = 0;
358 332
359 DBC_REQUIRE(refs > 0);
360 DBC_REQUIRE(hdcd_mgr);
361 DBC_REQUIRE(num_libs != NULL);
362 DBC_REQUIRE(num_pers_libs != NULL);
363 DBC_REQUIRE(uuid_obj != NULL);
364
365 status = get_dep_lib_info(hdcd_mgr, uuid_obj, num_libs, num_pers_libs, 333 status = get_dep_lib_info(hdcd_mgr, uuid_obj, num_libs, num_pers_libs,
366 NULL, NULL, phase); 334 NULL, NULL, phase);
367 335
@@ -393,10 +361,6 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
393 u32 dw_key_len; /* Len of REG key. */ 361 u32 dw_key_len; /* Len of REG key. */
394 char sz_obj_type[MAX_INT2CHAR_LENGTH]; /* str. rep. of obj_type. */ 362 char sz_obj_type[MAX_INT2CHAR_LENGTH]; /* str. rep. of obj_type. */
395 363
396 DBC_REQUIRE(refs > 0);
397 DBC_REQUIRE(obj_def != NULL);
398 DBC_REQUIRE(obj_uuid != NULL);
399
400 sz_uuid = kzalloc(MAXUUIDLEN, GFP_KERNEL); 364 sz_uuid = kzalloc(MAXUUIDLEN, GFP_KERNEL);
401 if (!sz_uuid) { 365 if (!sz_uuid) {
402 status = -ENOMEM; 366 status = -ENOMEM;
@@ -553,7 +517,6 @@ int dcd_get_objects(struct dcd_manager *hdcd_mgr,
553 struct dsp_uuid dsp_uuid_obj; 517 struct dsp_uuid dsp_uuid_obj;
554 s32 object_type; 518 s32 object_type;
555 519
556 DBC_REQUIRE(refs > 0);
557 if (!hdcd_mgr) { 520 if (!hdcd_mgr) {
558 status = -EFAULT; 521 status = -EFAULT;
559 goto func_end; 522 goto func_end;
@@ -663,11 +626,6 @@ int dcd_get_library_name(struct dcd_manager *hdcd_mgr,
663 int status = 0; 626 int status = 0;
664 struct dcd_key_elem *dcd_key = NULL; 627 struct dcd_key_elem *dcd_key = NULL;
665 628
666 DBC_REQUIRE(uuid_obj != NULL);
667 DBC_REQUIRE(str_lib_name != NULL);
668 DBC_REQUIRE(buff_size != NULL);
669 DBC_REQUIRE(hdcd_mgr);
670
671 dev_dbg(bridge, "%s: hdcd_mgr %p, uuid_obj %p, str_lib_name %p," 629 dev_dbg(bridge, "%s: hdcd_mgr %p, uuid_obj %p, str_lib_name %p,"
672 " buff_size %p\n", __func__, hdcd_mgr, uuid_obj, str_lib_name, 630 " buff_size %p\n", __func__, hdcd_mgr, uuid_obj, str_lib_name,
673 buff_size); 631 buff_size);
@@ -790,8 +748,6 @@ bool dcd_init(void)
790 bool init_cod; 748 bool init_cod;
791 bool ret = true; 749 bool ret = true;
792 750
793 DBC_REQUIRE(refs >= 0);
794
795 if (refs == 0) { 751 if (refs == 0) {
796 /* Initialize required modules. */ 752 /* Initialize required modules. */
797 init_cod = cod_init(); 753 init_cod = cod_init();
@@ -809,8 +765,6 @@ bool dcd_init(void)
809 if (ret) 765 if (ret)
810 refs++; 766 refs++;
811 767
812 DBC_ENSURE((ret && (refs > 0)) || (!ret && (refs == 0)));
813
814 return ret; 768 return ret;
815} 769}
816 770
@@ -832,15 +786,6 @@ int dcd_register_object(struct dsp_uuid *uuid_obj,
832 char sz_obj_type[MAX_INT2CHAR_LENGTH]; /* str. rep. of obj_type. */ 786 char sz_obj_type[MAX_INT2CHAR_LENGTH]; /* str. rep. of obj_type. */
833 struct dcd_key_elem *dcd_key = NULL; 787 struct dcd_key_elem *dcd_key = NULL;
834 788
835 DBC_REQUIRE(refs > 0);
836 DBC_REQUIRE(uuid_obj != NULL);
837 DBC_REQUIRE((obj_type == DSP_DCDNODETYPE) ||
838 (obj_type == DSP_DCDPROCESSORTYPE) ||
839 (obj_type == DSP_DCDLIBRARYTYPE) ||
840 (obj_type == DSP_DCDCREATELIBTYPE) ||
841 (obj_type == DSP_DCDEXECUTELIBTYPE) ||
842 (obj_type == DSP_DCDDELETELIBTYPE));
843
844 dev_dbg(bridge, "%s: object UUID %p, obj_type %d, szPathName %s\n", 789 dev_dbg(bridge, "%s: object UUID %p, obj_type %d, szPathName %s\n",
845 __func__, uuid_obj, obj_type, psz_path_name); 790 __func__, uuid_obj, obj_type, psz_path_name);
846 791
@@ -987,15 +932,6 @@ int dcd_unregister_object(struct dsp_uuid *uuid_obj,
987{ 932{
988 int status = 0; 933 int status = 0;
989 934
990 DBC_REQUIRE(refs > 0);
991 DBC_REQUIRE(uuid_obj != NULL);
992 DBC_REQUIRE((obj_type == DSP_DCDNODETYPE) ||
993 (obj_type == DSP_DCDPROCESSORTYPE) ||
994 (obj_type == DSP_DCDLIBRARYTYPE) ||
995 (obj_type == DSP_DCDCREATELIBTYPE) ||
996 (obj_type == DSP_DCDEXECUTELIBTYPE) ||
997 (obj_type == DSP_DCDDELETELIBTYPE));
998
999 /* 935 /*
1000 * When dcd_register_object is called with NULL as pathname, 936 * When dcd_register_object is called with NULL as pathname,
1001 * it indicates an unregister object operation. 937 * it indicates an unregister object operation.
@@ -1055,12 +991,6 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size,
1055 s32 entry_id; 991 s32 entry_id;
1056#endif 992#endif
1057 993
1058 DBC_REQUIRE(psz_buf != NULL);
1059 DBC_REQUIRE(ul_buf_size != 0);
1060 DBC_REQUIRE((obj_type == DSP_DCDNODETYPE)
1061 || (obj_type == DSP_DCDPROCESSORTYPE));
1062 DBC_REQUIRE(gen_obj != NULL);
1063
1064 switch (obj_type) { 994 switch (obj_type) {
1065 case DSP_DCDNODETYPE: 995 case DSP_DCDNODETYPE:
1066 /* 996 /*
@@ -1082,7 +1012,6 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size,
1082 token = strsep(&psz_cur, seps); 1012 token = strsep(&psz_cur, seps);
1083 1013
1084 /* ac_name */ 1014 /* ac_name */
1085 DBC_REQUIRE(token);
1086 token_len = strlen(token); 1015 token_len = strlen(token);
1087 if (token_len > DSP_MAXNAMELEN - 1) 1016 if (token_len > DSP_MAXNAMELEN - 1)
1088 token_len = DSP_MAXNAMELEN - 1; 1017 token_len = DSP_MAXNAMELEN - 1;
@@ -1167,7 +1096,6 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size,
1167 token = strsep(&psz_cur, seps); 1096 token = strsep(&psz_cur, seps);
1168 1097
1169 /* char *str_create_phase_fxn */ 1098 /* char *str_create_phase_fxn */
1170 DBC_REQUIRE(token);
1171 token_len = strlen(token); 1099 token_len = strlen(token);
1172 gen_obj->obj_data.node_obj.str_create_phase_fxn = 1100 gen_obj->obj_data.node_obj.str_create_phase_fxn =
1173 kzalloc(token_len + 1, GFP_KERNEL); 1101 kzalloc(token_len + 1, GFP_KERNEL);
@@ -1178,7 +1106,6 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size,
1178 token = strsep(&psz_cur, seps); 1106 token = strsep(&psz_cur, seps);
1179 1107
1180 /* char *str_execute_phase_fxn */ 1108 /* char *str_execute_phase_fxn */
1181 DBC_REQUIRE(token);
1182 token_len = strlen(token); 1109 token_len = strlen(token);
1183 gen_obj->obj_data.node_obj.str_execute_phase_fxn = 1110 gen_obj->obj_data.node_obj.str_execute_phase_fxn =
1184 kzalloc(token_len + 1, GFP_KERNEL); 1111 kzalloc(token_len + 1, GFP_KERNEL);
@@ -1189,7 +1116,6 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size,
1189 token = strsep(&psz_cur, seps); 1116 token = strsep(&psz_cur, seps);
1190 1117
1191 /* char *str_delete_phase_fxn */ 1118 /* char *str_delete_phase_fxn */
1192 DBC_REQUIRE(token);
1193 token_len = strlen(token); 1119 token_len = strlen(token);
1194 gen_obj->obj_data.node_obj.str_delete_phase_fxn = 1120 gen_obj->obj_data.node_obj.str_delete_phase_fxn =
1195 kzalloc(token_len + 1, GFP_KERNEL); 1121 kzalloc(token_len + 1, GFP_KERNEL);
@@ -1421,12 +1347,6 @@ static int get_dep_lib_info(struct dcd_manager *hdcd_mgr,
1421 u16 dep_libs = 0; 1347 u16 dep_libs = 0;
1422 int status = 0; 1348 int status = 0;
1423 1349
1424 DBC_REQUIRE(refs > 0);
1425
1426 DBC_REQUIRE(hdcd_mgr);
1427 DBC_REQUIRE(num_libs != NULL);
1428 DBC_REQUIRE(uuid_obj != NULL);
1429
1430 /* Initialize to 0 dependent libraries, if only counting number of 1350 /* Initialize to 0 dependent libraries, if only counting number of
1431 * dependent libraries */ 1351 * dependent libraries */
1432 if (!get_uuids) { 1352 if (!get_uuids) {