Skip to content

Commit

Permalink
staging:ti dspbridge: remove DSP_SUCCEEDED macro from rmgr
Browse files Browse the repository at this point in the history
Since status succeeded is now 0 macro DSP_SUCCEEDED
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ernesto Ramos authored and Greg Kroah-Hartman committed Jul 28, 2010
1 parent 157990f commit a741ea6
Show file tree
Hide file tree
Showing 12 changed files with 260 additions and 272 deletions.
24 changes: 12 additions & 12 deletions drivers/staging/tidspbridge/rmgr/dbdcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int dcd_create_manager(char *sz_zl_dll_name,
cod_delete(cod_mgr);
}

DBC_ENSURE((DSP_SUCCEEDED(status)) ||
DBC_ENSURE((!status) ||
((dcd_mgr_obj == NULL) && (status == -ENOMEM)));

func_end:
Expand Down Expand Up @@ -252,7 +252,7 @@ int dcd_enumerate_object(s32 index, enum dsp_dcdobjtype obj_type,
}
}

if (DSP_SUCCEEDED(status)) {
if (!status) {
len = strlen(sz_reg_key);
spin_lock(&dbdcd_lock);
list_for_each_entry(dcd_key, &reg_key_list, link) {
Expand All @@ -269,7 +269,7 @@ int dcd_enumerate_object(s32 index, enum dsp_dcdobjtype obj_type,
status = -ENODATA;
}

if (DSP_SUCCEEDED(status)) {
if (!status) {
/* Create UUID value using string retrieved from
* registry. */
uuid_uuid_from_string(sz_value, &dsp_uuid_obj);
Expand Down Expand Up @@ -446,7 +446,7 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
/* Retrieve paths from the registry based on struct dsp_uuid */
dw_buf_size = DCD_MAXPATHLENGTH;
}
if (DSP_SUCCEEDED(status)) {
if (!status) {
spin_lock(&dbdcd_lock);
list_for_each_entry(dcd_key, &reg_key_list, link) {
if (!strncmp(dcd_key->name, sz_reg_key,
Expand Down Expand Up @@ -500,7 +500,7 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
#else
status = cod_read_section(lib, sz_sect_name, psz_coff_buf, ul_len);
#endif
if (DSP_SUCCEEDED(status)) {
if (!status) {
/* Compres DSP buffer to conform to PC format. */
if (strstr(dcd_key->path, "iva") == NULL) {
compress_buf(psz_coff_buf, ul_len, DSPWORDSIZE);
Expand Down Expand Up @@ -585,7 +585,7 @@ int dcd_get_objects(struct dcd_manager *hdcd_mgr,
status =
cod_read_section(lib, DCD_REGISTER_SECTION, psz_coff_buf, ul_len);
#endif
if (DSP_SUCCEEDED(status)) {
if (!status) {
/* Compress DSP buffer to conform to PC format. */
if (strstr(sz_coff_path, "iva") == NULL) {
compress_buf(psz_coff_buf, ul_len, DSPWORDSIZE);
Expand Down Expand Up @@ -699,7 +699,7 @@ int dcd_get_library_name(struct dcd_manager *hdcd_mgr,
status = -EINVAL;
DBC_ASSERT(false);
}
if (DSP_SUCCEEDED(status)) {
if (!status) {
if ((strlen(sz_reg_key) + strlen(sz_obj_type)) <
DCD_MAXPATHLENGTH) {
strncat(sz_reg_key, sz_obj_type,
Expand All @@ -714,7 +714,7 @@ int dcd_get_library_name(struct dcd_manager *hdcd_mgr,
else
status = -EPERM;
}
if (DSP_SUCCEEDED(status)) {
if (!status) {
spin_lock(&dbdcd_lock);
list_for_each_entry(dcd_key, &reg_key_list, link) {
/* See if the name matches. */
Expand Down Expand Up @@ -767,7 +767,7 @@ int dcd_get_library_name(struct dcd_manager *hdcd_mgr,
0 : -ENOKEY;
}

if (DSP_SUCCEEDED(status))
if (!status)
memcpy(str_lib_name, dcd_key->path, strlen(dcd_key->path) + 1);
return status;
}
Expand Down Expand Up @@ -955,7 +955,7 @@ int dcd_register_object(struct dsp_uuid *uuid_obj,
status = -EPERM;
}

if (DSP_SUCCEEDED(status)) {
if (!status) {
/*
* Because the node database has been updated through a
* successful object registration/de-registration operation,
Expand Down Expand Up @@ -1441,11 +1441,11 @@ static int get_dep_lib_info(struct dcd_manager *hdcd_mgr,
}

/* Open the library */
if (DSP_SUCCEEDED(status)) {
if (!status) {
status = cod_open(dcd_mgr_obj->cod_mgr, psz_file_name,
COD_NOLOAD, &lib);
}
if (DSP_SUCCEEDED(status)) {
if (!status) {
/* Get dependent library section information. */
status = cod_get_section(lib, DEPLIBSECT, &ul_addr, &ul_len);

Expand Down
34 changes: 17 additions & 17 deletions drivers/staging/tidspbridge/rmgr/disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ int disp_create(struct disp_object **dispatch_obj,
disp_obj->hdev_obj = hdev_obj;

/* Get Channel manager and Bridge function interface */
if (DSP_SUCCEEDED(status)) {
if (!status) {
status = dev_get_chnl_mgr(hdev_obj, &(disp_obj->hchnl_mgr));
if (DSP_SUCCEEDED(status)) {
if (!status) {
(void)dev_get_intf_fxns(hdev_obj, &intf_fxns);
disp_obj->intf_fxns = intf_fxns;
}
Expand Down Expand Up @@ -146,15 +146,15 @@ int disp_create(struct disp_object **dispatch_obj,
CHNL_MODETODSP, ul_chnl_id,
&chnl_attr_obj);

if (DSP_SUCCEEDED(status)) {
if (!status) {
ul_chnl_id = disp_attrs->ul_chnl_offset + CHNLFROMRMSOFFSET;
status =
(*intf_fxns->pfn_chnl_open) (&(disp_obj->chnl_from_dsp),
disp_obj->hchnl_mgr,
CHNL_MODEFROMDSP, ul_chnl_id,
&chnl_attr_obj);
}
if (DSP_SUCCEEDED(status)) {
if (!status) {
/* Allocate buffer for commands, replies */
disp_obj->ul_bufsize = disp_attrs->ul_chnl_buf_size;
disp_obj->ul_bufsize_rms = RMS_COMMANDBUFSIZE;
Expand All @@ -163,13 +163,13 @@ int disp_create(struct disp_object **dispatch_obj,
status = -ENOMEM;
}
func_cont:
if (DSP_SUCCEEDED(status))
if (!status)
*dispatch_obj = disp_obj;
else
delete_disp(disp_obj);

DBC_ENSURE(((DSP_FAILED(status)) && ((*dispatch_obj == NULL))) ||
((DSP_SUCCEEDED(status)) && *dispatch_obj));
(!status && *dispatch_obj));
return status;
}

Expand Down Expand Up @@ -345,7 +345,7 @@ int disp_node_create(struct disp_object *disp_obj,
* Socket Args (if DAIS socket node):
*
*/
if (DSP_SUCCEEDED(status)) {
if (!status) {
total = 0; /* Total number of words in buffer so far */
pdw_buf = (rms_word *) disp_obj->pbuf;
rms_cmd = (struct rms_command *)pdw_buf;
Expand Down Expand Up @@ -439,7 +439,7 @@ int disp_node_create(struct disp_object *disp_obj,
offset = total;
}
for (i = 0; (i < task_arg_obj.num_outputs) &&
(DSP_SUCCEEDED(status)); i++) {
(!status); i++) {
pdw_buf[sio_out_def_offset + i] =
(offset - args_offset)
* (sizeof(rms_word) / DSPWORDSIZE);
Expand All @@ -455,12 +455,12 @@ int disp_node_create(struct disp_object *disp_obj,
status = -EPERM;
}
}
if (DSP_SUCCEEDED(status)) {
if (!status) {
ul_bytes = total * sizeof(rms_word);
DBC_ASSERT(ul_bytes < (RMS_COMMANDBUFSIZE * sizeof(rms_word)));
status = send_message(disp_obj, node_get_timeout(hnode),
ul_bytes, node_env);
if (DSP_SUCCEEDED(status)) {
if (status >= 0) {
/*
* Message successfully received from RMS.
* Return the status of the Node's create function
Expand Down Expand Up @@ -497,7 +497,7 @@ int disp_node_delete(struct disp_object *disp_obj,

status = dev_get_dev_type(disp_obj->hdev_obj, &dev_type);

if (DSP_SUCCEEDED(status)) {
if (!status) {

if (dev_type == DSP_UNIT) {

Expand All @@ -513,7 +513,7 @@ int disp_node_delete(struct disp_object *disp_obj,
status = send_message(disp_obj, node_get_timeout(hnode),
sizeof(struct rms_command),
&dw_arg);
if (DSP_SUCCEEDED(status)) {
if (status >= 0) {
/*
* Message successfully received from RMS.
* Return the status of the Node's delete
Expand Down Expand Up @@ -550,7 +550,7 @@ int disp_node_run(struct disp_object *disp_obj,

status = dev_get_dev_type(disp_obj->hdev_obj, &dev_type);

if (DSP_SUCCEEDED(status)) {
if (!status) {

if (dev_type == DSP_UNIT) {

Expand All @@ -566,7 +566,7 @@ int disp_node_run(struct disp_object *disp_obj,
status = send_message(disp_obj, node_get_timeout(hnode),
sizeof(struct rms_command),
&dw_arg);
if (DSP_SUCCEEDED(status)) {
if (status >= 0) {
/*
* Message successfully received from RMS.
* Return the status of the Node's execute
Expand Down Expand Up @@ -649,7 +649,7 @@ static int fill_stream_def(rms_word *pdw_buf, u32 *ptotal, u32 offset,
strm_def_obj->timeout = strm_def.utimeout;
}

if (DSP_SUCCEEDED(status)) {
if (!status) {
/*
* Since we haven't added the device name yet, subtract
* 1 from total.
Expand Down Expand Up @@ -709,7 +709,7 @@ static int send_message(struct disp_object *disp_obj, u32 timeout,

status =
(*intf_fxns->pfn_chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj);
if (DSP_SUCCEEDED(status)) {
if (!status) {
if (!CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) {
if (CHNL_IS_TIMED_OUT(chnl_ioc_obj))
status = -ETIME;
Expand All @@ -730,7 +730,7 @@ static int send_message(struct disp_object *disp_obj, u32 timeout,

status =
(*intf_fxns->pfn_chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj);
if (DSP_SUCCEEDED(status)) {
if (!status) {
if (CHNL_IS_TIMED_OUT(chnl_ioc_obj)) {
status = -ETIME;
} else if (chnl_ioc_obj.byte_size < ul_bytes) {
Expand Down
31 changes: 14 additions & 17 deletions drivers/staging/tidspbridge/rmgr/drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int drv_insert_node_res_element(void *hnode, void *node_resource,
if (*node_res_obj == NULL)
status = -EFAULT;

if (DSP_SUCCEEDED(status)) {
if (!status) {
if (mutex_lock_interruptible(&ctxt->node_mutex)) {
kfree(*node_res_obj);
return -EPERM;
Expand Down Expand Up @@ -282,7 +282,7 @@ int drv_proc_insert_strm_res_element(void *stream_obj,
if (*pstrm_res == NULL)
status = -EFAULT;

if (DSP_SUCCEEDED(status)) {
if (!status) {
if (mutex_lock_interruptible(&ctxt->strm_mutex)) {
kfree(*pstrm_res);
return -EPERM;
Expand Down Expand Up @@ -453,9 +453,9 @@ int drv_create(struct drv_object **drv_obj)
status = -ENOMEM;
}
/* Store the DRV Object in the Registry */
if (DSP_SUCCEEDED(status))
if (!status)
status = cfg_set_object((u32) pdrv_object, REG_DRV_OBJECT);
if (DSP_SUCCEEDED(status)) {
if (!status) {
*drv_obj = pdrv_object;
} else {
kfree(pdrv_object->dev_list);
Expand Down Expand Up @@ -556,7 +556,7 @@ u32 drv_get_first_dev_object(void)
u32 dw_dev_object = 0;
struct drv_object *pdrv_obj;

if (DSP_SUCCEEDED(cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT))) {
if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {
if ((pdrv_obj->dev_list != NULL) &&
!LST_IS_EMPTY(pdrv_obj->dev_list))
dw_dev_object = (u32) lst_first(pdrv_obj->dev_list);
Expand All @@ -576,7 +576,7 @@ u32 drv_get_first_dev_extension(void)
u32 dw_dev_extension = 0;
struct drv_object *pdrv_obj;

if (DSP_SUCCEEDED(cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT))) {
if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {

if ((pdrv_obj->dev_node_string != NULL) &&
!LST_IS_EMPTY(pdrv_obj->dev_node_string)) {
Expand All @@ -602,7 +602,7 @@ u32 drv_get_next_dev_object(u32 hdev_obj)

DBC_REQUIRE(hdev_obj != 0);

if (DSP_SUCCEEDED(cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT))) {
if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {

if ((pdrv_obj->dev_list != NULL) &&
!LST_IS_EMPTY(pdrv_obj->dev_list)) {
Expand All @@ -629,7 +629,7 @@ u32 drv_get_next_dev_extension(u32 dev_extension)

DBC_REQUIRE(dev_extension != 0);

if (DSP_SUCCEEDED(cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT))) {
if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {
if ((pdrv_obj->dev_node_string != NULL) &&
!LST_IS_EMPTY(pdrv_obj->dev_node_string)) {
dw_dev_extension =
Expand Down Expand Up @@ -668,7 +668,6 @@ int drv_init(void)
int drv_insert_dev_object(struct drv_object *driver_obj,
struct dev_object *hdev_obj)
{
int status = 0;
struct drv_object *pdrv_object = (struct drv_object *)driver_obj;

DBC_REQUIRE(refs > 0);
Expand All @@ -678,10 +677,9 @@ int drv_insert_dev_object(struct drv_object *driver_obj,

lst_put_tail(pdrv_object->dev_list, (struct list_head *)hdev_obj);

DBC_ENSURE(DSP_SUCCEEDED(status)
&& !LST_IS_EMPTY(pdrv_object->dev_list));
DBC_ENSURE(!LST_IS_EMPTY(pdrv_object->dev_list));

return status;
return 0;
}

/*
Expand Down Expand Up @@ -746,7 +744,7 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg)
*/

status = cfg_get_object((u32 *) &pdrv_object, REG_DRV_OBJECT);
if (DSP_SUCCEEDED(status)) {
if (!status) {
pszdev_node = kzalloc(sizeof(struct drv_ext), GFP_KERNEL);
if (pszdev_node) {
lst_init_elem(&pszdev_node->link);
Expand All @@ -767,7 +765,7 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg)
*dev_node_strg = 0;
}

DBC_ENSURE((DSP_SUCCEEDED(status) && dev_node_strg != NULL &&
DBC_ENSURE((!status && dev_node_strg != NULL &&
!LST_IS_EMPTY(pdrv_object->dev_node_string)) ||
(DSP_FAILED(status) && *dev_node_strg == 0));

Expand Down Expand Up @@ -820,7 +818,6 @@ int drv_release_resources(u32 dw_context, struct drv_object *hdrv_obj)
*/
static int request_bridge_resources(struct cfg_hostres *res)
{
int status = 0;
struct cfg_hostres *host_res = res;

/* num_mem_windows must not be more than CFG_MAXMEMREGISTERS */
Expand All @@ -845,7 +842,7 @@ static int request_bridge_resources(struct cfg_hostres *res)
host_res->dw_num_chnls = CHNL_MAXCHANNELS;
host_res->dw_chnl_buf_size = 0x400;

return status;
return 0;
}

/*
Expand Down Expand Up @@ -919,7 +916,7 @@ int drv_request_bridge_res_dsp(void **phost_resources)
dma_addr, shm_size);
}
}
if (DSP_SUCCEEDED(status)) {
if (!status) {
/* These are hard-coded values */
host_res->birq_registers = 0;
host_res->birq_attrib = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/tidspbridge/rmgr/drv_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ static long bridge_ioctl(struct file *filp, unsigned int code,
status = api_call_dev_ioctl(code, &buf_in, &retval,
filp->private_data);

if (DSP_SUCCEEDED(status)) {
if (!status) {
status = retval;
} else {
dev_dbg(bridge, "%s: IOCTL Failed, code: 0x%x "
Expand Down
Loading

0 comments on commit a741ea6

Please sign in to comment.