From patchwork Sat Mar 27 02:28:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hebbar, Shivananda" X-Patchwork-Id: 88666 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2R2SrnM014991 for ; Sat, 27 Mar 2010 02:28:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910Ab0C0C2k (ORCPT ); Fri, 26 Mar 2010 22:28:40 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:41927 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752882Ab0C0C2i convert rfc822-to-8bit (ORCPT ); Fri, 26 Mar 2010 22:28:38 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o2R2SYSt028818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 26 Mar 2010 21:28:37 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id o2R2SYLA026655 for ; Sat, 27 Mar 2010 07:58:34 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde71.ent.ti.com ([172.24.170.149]) with mapi; Sat, 27 Mar 2010 07:58:34 +0530 From: "Hebbar, Shivananda" To: "linux-omap@vger.kernel.org" Date: Sat, 27 Mar 2010 07:58:31 +0530 Subject: [RFC][PATCH v1 12/19] DSPBRIDGE: Cleanup custom error code (DSP_ESIZE -> -EINVAL) Thread-Topic: [RFC][PATCH v1 12/19] DSPBRIDGE: Cleanup custom error code (DSP_ESIZE -> -EINVAL) Thread-Index: AcrNVTFlLMDly+FVTGGUFedjgSVOFg== Message-ID: <19F8576C6E063C45BE387C64729E7394044DEBEE12@dbde02.ent.ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 27 Mar 2010 02:28:55 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/dspbridge/errbase.h b/arch/arm/plat-omap/include/dspbridge/errbase.h index 1cc0101..87667a6 100644 --- a/arch/arm/plat-omap/include/dspbridge/errbase.h +++ b/arch/arm/plat-omap/include/dspbridge/errbase.h @@ -99,9 +99,6 @@ /* I/O is currently pending. */ #define DSP_EPENDING (DSP_EBASE + 0x11) -/* An invalid size parameter was specified. */ -#define DSP_ESIZE (DSP_EBASE + 0x14) - /* A stream creation failure occurred on the DSP. */ #define DSP_ESTREAM (DSP_EBASE + 0x15) diff --git a/arch/arm/plat-omap/include/dspbridge/node.h b/arch/arm/plat-omap/include/dspbridge/node.h index 814065f..7d882f2 100644 --- a/arch/arm/plat-omap/include/dspbridge/node.h +++ b/arch/arm/plat-omap/include/dspbridge/node.h @@ -79,7 +79,7 @@ extern dsp_status node_allocate(struct proc_object *hprocessor, * -EFAULT: Invalid node handle. * -ENOMEM: Insufficent memory. * DSP_EFAIL: General Failure. - * DSP_ESIZE: Invalid Size. + * -EINVAL: Invalid Size. * Requires: * node_init(void) called. * pbuffer != NULL. @@ -292,14 +292,14 @@ extern dsp_status node_delete_mgr(struct node_mgr *hnode_mgr); * pu_allocated: Location to write total number of allocated nodes. * Returns: * DSP_SOK: Success. - * DSP_ESIZE: node_tab is too small to hold all node handles. + * -EINVAL: node_tab is too small to hold all node handles. * Requires: * Valid hnode_mgr. * node_tab != NULL || node_tab_size == 0. * pu_num_nodes != NULL. * pu_allocated != NULL. * Ensures: - * - (DSP_ESIZE && *pu_num_nodes == 0) + * - (EINVAL && *pu_num_nodes == 0) * - || (DSP_SOK && *pu_num_nodes <= node_tab_size) && * (*pu_allocated == *pu_num_nodes) */ diff --git a/arch/arm/plat-omap/include/dspbridge/proc.h b/arch/arm/plat-omap/include/dspbridge/proc.h index 5220a1b..64b208c 100644 --- a/arch/arm/plat-omap/include/dspbridge/proc.h +++ b/arch/arm/plat-omap/include/dspbridge/proc.h @@ -138,7 +138,7 @@ extern dsp_status proc_detach(struct process_context *pr_ctxt); * Returns: * DSP_SOK : Success. * -EFAULT : Invalid processor handle. - * DSP_ESIZE : The amount of memory allocated for node_tab is + * -EINVAL : The amount of memory allocated for node_tab is * insufficent. That is the number of nodes actually * allocated on the DSP is greater than the value * specified for node_tab_size. diff --git a/arch/arm/plat-omap/include/dspbridge/strm.h b/arch/arm/plat-omap/include/dspbridge/strm.h index 73902a8..6f86c04 100644 --- a/arch/arm/plat-omap/include/dspbridge/strm.h +++ b/arch/arm/plat-omap/include/dspbridge/strm.h @@ -38,7 +38,7 @@ * -EFAULT: Invalid hStrm. * -ENOMEM: Insufficient memory. * DSP_EFAIL: Failure occurred, unable to allocate buffers. - * DSP_ESIZE: usize must be > 0 bytes. + * -EINVAL: usize must be > 0 bytes. * Requires: * strm_init(void) called. * ap_buffer != NULL. @@ -172,7 +172,7 @@ extern dsp_status strm_get_event_handle(struct strm_object *hStrm, * Returns: * DSP_SOK: Success. * -EFAULT: Invalid hStrm. - * DSP_ESIZE: stream_info_size < sizeof(dsp_streaminfo). + * -EINVAL: stream_info_size < sizeof(dsp_streaminfo). * DSP_EFAIL: Unable to get stream info. * Requires: * strm_init(void) called. diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c index 6937ea6..7186f5d 100644 --- a/drivers/dsp/bridge/pmgr/wcd.c +++ b/drivers/dsp/bridge/pmgr/wcd.c @@ -420,7 +420,7 @@ u32 mgrwrap_enum_node_info(union Trapped_Args *args, void *pr_ctxt) u32 size = args->args_mgr_enumnode_info.undb_props_size; if (size < sizeof(struct dsp_ndbprops)) - return DSP_ESIZE; + return -EINVAL; pndb_props = mem_alloc(size, MEM_NONPAGED); if (pndb_props == NULL) @@ -452,7 +452,7 @@ u32 mgrwrap_enum_proc_info(union Trapped_Args *args, void *pr_ctxt) u32 size = args->args_mgr_enumproc_info.processor_info_size; if (size < sizeof(struct dsp_processorinfo)) - return DSP_ESIZE; + return -EINVAL; processor_info = mem_alloc(size, MEM_NONPAGED); if (processor_info == NULL) @@ -664,7 +664,7 @@ u32 procwrap_enum_node_info(union Trapped_Args *args, void *pr_ctxt) u32 alloc_cnt; if (!args->args_proc_enumnode_info.node_tab_size) - return DSP_ESIZE; + return -EINVAL; status = proc_enum_nodes(args->args_proc_enumnode_info.hprocessor, node_tab, @@ -721,7 +721,7 @@ u32 procwrap_enum_resources(union Trapped_Args *args, void *pr_ctxt) if (args->args_proc_enumresources.resource_info_size < sizeof(struct dsp_resourceinfo)) - return DSP_ESIZE; + return -EINVAL; status = proc_get_resource_info(args->args_proc_enumresources.hprocessor, @@ -747,7 +747,7 @@ u32 procwrap_get_state(union Trapped_Args *args, void *pr_ctxt) if (args->args_proc_getstate.state_info_size < sizeof(struct dsp_processorstate)) - return DSP_ESIZE; + return -EINVAL; status = proc_get_state(args->args_proc_getstate.hprocessor, &proc_state, @@ -767,7 +767,7 @@ u32 procwrap_get_trace(union Trapped_Args *args, void *pr_ctxt) u8 *pbuf; if (args->args_proc_gettrace.max_size > MAX_TRACEBUFLEN) - return DSP_ESIZE; + return -EINVAL; pbuf = mem_calloc(args->args_proc_gettrace.max_size, MEM_NONPAGED); if (pbuf != NULL) { @@ -909,7 +909,7 @@ u32 procwrap_map(union Trapped_Args *args, void *pr_ctxt) void *map_addr; if (!args->args_proc_mapmem.ul_size) - return DSP_ESIZE; + return -EINVAL; status = proc_map(args->args_proc_mapmem.hprocessor, args->args_proc_mapmem.pmpu_addr, @@ -959,7 +959,7 @@ u32 procwrap_reserve_memory(union Trapped_Args *args, void *pr_ctxt) if ((args->args_proc_rsvmem.ul_size <= 0) || (args->args_proc_rsvmem.ul_size & (PG_SIZE4K - 1)) != 0) - return DSP_ESIZE; + return -EINVAL; status = proc_reserve_memory(args->args_proc_rsvmem.hprocessor, args->args_proc_rsvmem.ul_size, &prsv_addr, @@ -1092,7 +1092,7 @@ u32 nodewrap_alloc_msg_buf(union Trapped_Args *args, void *pr_ctxt) u8 *pbuffer = NULL; if (!args->args_node_allocmsgbuf.usize) - return DSP_ESIZE; + return -EINVAL; if (args->args_node_allocmsgbuf.pattr) { /* Optional argument */ CP_FM_USR(&attr, args->args_node_allocmsgbuf.pattr, status, 1); diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c index 9fa7569..9af0453 100644 --- a/drivers/dsp/bridge/rmgr/node.c +++ b/drivers/dsp/bridge/rmgr/node.c @@ -1639,7 +1639,7 @@ dsp_status node_enum_nodes(struct node_mgr *hnode_mgr, void **node_tab, if (hnode_mgr->num_nodes > node_tab_size) { *pu_allocated = hnode_mgr->num_nodes; *pu_num_nodes = 0; - status = DSP_ESIZE; + status = -EINVAL; } else { hnode = (struct node_object *) lst_first(hnode_mgr->node_list); diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c index af9f2c2..d79971f 100644 --- a/drivers/dsp/bridge/rmgr/proc.c +++ b/drivers/dsp/bridge/rmgr/proc.c @@ -1351,7 +1351,7 @@ dsp_status proc_stop(void *hprocessor) if (DSP_SUCCEEDED(status) && hnode_mgr) { status = node_enum_nodes(hnode_mgr, &hnode, node_tab_size, &num_nodes, &nodes_allocated); - if ((status == DSP_ESIZE) || (nodes_allocated > 0)) { + if ((status == -EINVAL) || (nodes_allocated > 0)) { pr_err("%s: Can't stop device, active nodes = %d \n", __func__, nodes_allocated); return DSP_EWRONGSTATE; diff --git a/drivers/dsp/bridge/rmgr/strm.c b/drivers/dsp/bridge/rmgr/strm.c index 13826fc..add68f0 100644 --- a/drivers/dsp/bridge/rmgr/strm.c +++ b/drivers/dsp/bridge/rmgr/strm.c @@ -121,7 +121,7 @@ dsp_status strm_allocate_buffer(struct strm_object *hStrm, u32 usize, * Allocate from segment specified at time of stream open. */ if (usize == 0) - status = DSP_ESIZE; + status = -EINVAL; } else { status = -EFAULT; @@ -336,7 +336,7 @@ dsp_status strm_get_info(struct strm_object *hStrm, } else { if (stream_info_size < sizeof(struct stream_info)) { /* size of users info */ - status = DSP_ESIZE; + status = -EINVAL; } } if (DSP_FAILED(status)) diff --git a/drivers/dsp/bridge/services/cfg.c b/drivers/dsp/bridge/services/cfg.c index 4f99554..36f1a7b 100644 --- a/drivers/dsp/bridge/services/cfg.c +++ b/drivers/dsp/bridge/services/cfg.c @@ -162,7 +162,7 @@ dsp_status cfg_get_exec_file(struct cfg_devnode *dev_node_obj, u32 ul_buf_size, if (DSP_FAILED(status)) status = CFG_E_RESOURCENOTAVAIL; else if (exec_size > ul_buf_size) - status = DSP_ESIZE; + status = -EINVAL; } if (DSP_FAILED(status))