}
}
- DBC_ENSURE(DSP_FAILED(status) || chnl_mgr_obj);
+ DBC_ENSURE(status || chnl_mgr_obj);
return status;
}
if (buf_pa) {
status = cmm_free_buf(xlator_obj->hcmm_mgr, buf_pa,
xlator_obj->ul_seg_id);
- if (DSP_FAILED(status)) {
+ if (status) {
/* Uh oh, this shouldn't happen. Descriptor
* gone! */
DBC_ASSERT(false); /* CMM is leaking mem */
status = mgr_new->fxns.create_fxn(&mgr_new->target, &zl_attrs);
- if (DSP_FAILED(status)) {
+ if (status) {
cod_delete(mgr_new);
return -ESPIPE;
}
status = cod_mgr_obj->fxns.load_fxn(cod_mgr_obj->base_lib, flags,
&new_attrs,
&cod_mgr_obj->ul_entry);
- if (DSP_FAILED(status))
+ if (status)
cod_mgr_obj->fxns.close_fxn(cod_mgr_obj->base_lib);
if (!status)
*lib_obj = lib;
}
- if (DSP_FAILED(status))
+ if (status)
pr_err("%s: error status 0x%x, sz_coff_path: %s flags: 0x%x\n",
__func__, status, sz_coff_path, flags);
return status;
hmgr->sz_zl_file[COD_MAXPATHLENGTH - 1] = '\0';
}
- if (DSP_FAILED(status))
+ if (status)
pr_err("%s: error status 0x%x sz_coff_path: %s\n", __func__,
status, sz_coff_path);
return status;
*target_obj = (struct dbll_tar_obj *)pzl_target;
}
DBC_ENSURE((!status && *target_obj) ||
- (DSP_FAILED(status) && *target_obj == NULL));
+ (status && *target_obj == NULL));
}
return status;
if (opened_doff)
dof_close(zl_lib);
- DBC_ENSURE(DSP_FAILED(status) || zl_lib->load_ref > 0);
+ DBC_ENSURE(status || zl_lib->load_ref > 0);
dev_dbg(bridge, "%s: lib: %p flags: 0x%x entry: %p, status 0x%x\n",
__func__, lib, flags, entry, status);
/*
* Set up objects needed by the dynamic loader
*/
- if (DSP_FAILED(status))
+ if (status)
goto func_cont;
/* Stream */
}
DBC_ENSURE((!status && (zl_lib->open_ref > 0) && *lib_obj)
- || (DSP_FAILED(status) && *lib_obj == NULL));
+ || (status && *lib_obj == NULL));
dev_dbg(bridge, "%s: target: %p file: %s lib_obj: %p, status 0x%x\n",
__func__, target, file, lib_obj, status);
} else {
status = -EFAULT;
}
- if (DSP_FAILED(status))
+ if (status)
goto func_cont;
byte_size = 1;
(u32 *) &rmm_addr_obj,
seg_id, req, false);
}
- if (DSP_FAILED(status)) {
+ if (status) {
ret = false;
} else {
/* RMM gives word address. Need to convert to byte address */
status = drv_request_bridge_res_dsp((void *)&host_res);
- if (DSP_FAILED(status)) {
+ if (status) {
dev_dbg(bridge, "%s: Failed to reserve bridge resources\n",
__func__);
goto leave;
/* Get the Bridge driver interface functions */
bridge_drv_entry(&drv_fxns, driver_file_name);
- if (DSP_FAILED(cfg_get_object((u32 *) &hdrv_obj, REG_DRV_OBJECT))) {
+ if (cfg_get_object((u32 *) &hdrv_obj, REG_DRV_OBJECT)) {
/* don't propogate CFG errors from this PROC function */
status = -EPERM;
}
(&dev_obj->hbridge_context, dev_obj,
host_res);
/* Assert bridge_dev_create()'s ensure clause: */
- DBC_ASSERT(DSP_FAILED(status)
+ DBC_ASSERT(status
|| (dev_obj->hbridge_context != NULL));
} else {
status = -ENOMEM;
*device_obj = NULL;
}
- DBC_ENSURE((!status && *device_obj) ||
- (DSP_FAILED(status) && !*device_obj));
+ DBC_ENSURE((!status && *device_obj) || (status && !*device_obj));
return status;
}
/* There can be only one Node Manager per DEV object */
DBC_ASSERT(!dev_obj->hnode_mgr);
status = node_create_mgr(&dev_obj->hnode_mgr, hdev_obj);
- if (DSP_FAILED(status))
+ if (status)
dev_obj->hnode_mgr = NULL;
DBC_ENSURE((!status && dev_obj->hnode_mgr != NULL)
- || (DSP_FAILED(status) && dev_obj->hnode_mgr == NULL));
+ || (status && dev_obj->hnode_mgr == NULL));
return status;
}
DBC_REQUIRE(hdev_obj);
if (dev_obj->hnode_mgr) {
- if (DSP_FAILED(node_delete_mgr(dev_obj->hnode_mgr)))
+ if (node_delete_mgr(dev_obj->hnode_mgr))
status = -EPERM;
else
dev_obj->hnode_mgr = NULL;
}
- DBC_ENSURE((!status && dev_obj->hnode_mgr == NULL) ||
- DSP_FAILED(status));
+ DBC_ENSURE((!status && dev_obj->hnode_mgr == NULL) || status);
return status;
}
else
status = -EFAULT;
- DBC_ENSURE(DSP_FAILED(status) || (dev_obj->hchnl_mgr == hmgr));
+ DBC_ENSURE(status || (dev_obj->hchnl_mgr == hmgr));
return status;
}
if (!status) {
/* Store away the hdev_obj with the DEVNODE */
status = cfg_set_dev_object(dev_node_obj, (u32) hdev_obj);
- if (DSP_FAILED(status)) {
+ if (status) {
/* Clean up */
dev_destroy_device(hdev_obj);
hdev_obj = NULL;
/* Create the Manager Object */
status = mgr_create(&hmgr_obj, dev_node_obj);
}
- if (DSP_FAILED(status)) {
+ if (status) {
if (hdev_obj)
dev_destroy_device(hdev_obj);
}
}
- if (DSP_FAILED(status))
+ if (status)
pr_err("%s: failure, status 0x%x\n", __func__, status);
return status;
static inline void _cp_fm_usr(void *to, const void __user * from,
int *err, unsigned long bytes)
{
- if (DSP_FAILED(*err))
+ if (*err)
return;
if (unlikely(!from)) {
static inline void _cp_to_usr(void __user *to, const void *from,
int *err, unsigned long bytes)
{
- if (DSP_FAILED(*err))
+ if (*err)
return;
if (unlikely(!to)) {
* requires KFILE. */
for (hdev_obj = dev_get_first(); hdev_obj != NULL;
hdev_obj = dev_get_next(hdev_obj)) {
- if (DSP_FAILED(dev_get_dev_node(hdev_obj, &dev_node)))
+ if (dev_get_dev_node(hdev_obj, &dev_node))
continue;
- if (DSP_FAILED(dev_get_dev_type(hdev_obj, &dev_type)))
+ if (dev_get_dev_type(hdev_obj, &dev_type))
continue;
if ((dev_type == DSP_UNIT) || (dev_type == IVA_UNIT))
int status = 0;
CP_FM_USR(&uuid_obj, args->args_mgr_registerobject.uuid_obj, status, 1);
- if (DSP_FAILED(status))
+ if (status)
goto func_end;
/* path_size is increased by 1 to accommodate NULL */
path_size = strlen_user((char *)
struct dsp_uuid uuid_obj;
CP_FM_USR(&uuid_obj, args->args_mgr_registerobject.uuid_obj, status, 1);
- if (DSP_FAILED(status))
+ if (status)
goto func_end;
status = dcd_unregister_object(&uuid_obj,
}
CP_FM_USR(argv, args->args_proc_load.user_args, status, count);
- if (DSP_FAILED(status)) {
+ if (status) {
kfree(argv);
argv = NULL;
goto func_cont;
argv[i] = kmalloc(len, GFP_KERNEL);
if (argv[i]) {
CP_FM_USR(argv[i], temp, status, len);
- if (DSP_FAILED(status)) {
+ if (status) {
kfree(argv[i]);
argv[i] = NULL;
goto func_cont;
}
CP_FM_USR(envp, args->args_proc_load.user_envp, status, count);
- if (DSP_FAILED(status)) {
+ if (status) {
kfree(envp);
envp = NULL;
goto func_cont;
envp[i] = kmalloc(len, GFP_KERNEL);
if (envp[i]) {
CP_FM_USR(envp[i], temp, status, len);
- if (DSP_FAILED(status)) {
+ if (status) {
kfree(envp[i]);
envp[i] = NULL;
goto func_cont;
cb_data_size);
}
CP_FM_USR(&node_uuid, args->args_node_allocate.node_id_ptr, status, 1);
- if (DSP_FAILED(status))
+ if (status)
goto func_cont;
/* Optional argument */
if (args->args_node_allocate.attr_in) {
}
if (!status) {
CP_TO_USR(args->args_node_allocate.ph_node, &hnode, status, 1);
- if (DSP_FAILED(status)) {
+ if (status) {
status = -EFAULT;
node_delete(hnode, pr_ctxt);
}
}
CP_FM_USR(pargs, args->args_node_connect.conn_param, status,
cb_data_size);
- if (DSP_FAILED(status))
+ if (status)
goto func_cont;
}
if (args->args_node_connect.pattrs) { /* Optional argument */
CP_FM_USR(&node_uuid, args->args_node_getuuidprops.node_id_ptr, status,
1);
- if (DSP_FAILED(status))
+ if (status)
goto func_cont;
pnode_props = kmalloc(sizeof(struct dsp_ndbprops), GFP_KERNEL);
if (pnode_props != NULL) {
if (!status) {
CP_TO_USR(args->args_strm_allocatebuffer.ap_buffer, ap_buffer,
status, num_bufs);
- if (DSP_FAILED(status)) {
+ if (status) {
status = -EFAULT;
strm_free_buffer(args->args_strm_allocatebuffer.hstream,
ap_buffer, num_bufs, pr_ctxt);