[PATCH v3 7/7] DSPBRIDGE: remove WCD_Cmd structure

2010-01-11 Thread Omar Ramirez Luna
Remove WCD_Cmd structure given that only one member is being
used (fxn call), this structure is replaced for a definition
of an array of function pointers for each dspbridge ioctl
module.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
CC: Nishanth Menon n...@ti.com
CC: Hiroshi Doyu hiroshi.d...@nokia.com
CC: Ameya Palande ameya.pala...@nokia.com
CC: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/dsp/bridge/pmgr/wcd.c |  134 +++-
 1 files changed, 64 insertions(+), 70 deletions(-)

diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c
index 27e8e8e..37d1f8a 100644
--- a/drivers/dsp/bridge/pmgr/wcd.c
+++ b/drivers/dsp/bridge/pmgr/wcd.c
@@ -147,12 +147,6 @@
 /* Used to get dspbridge ioctl table */
 #define DB_GET_IOC_TABLE(cmd)  (DB_GET_MODULE(cmd)  DB_MODULE_SHIFT)
 
-/* Device IOCtl function pointer */
-struct WCD_Cmd {
-   u32(*fxn)(union Trapped_Args *args, void *pr_ctxt);
-   u32 dwIndex;
-} ;
-
 /*  --- Globals */
 #if GT_TRACE
 static struct GT_Mask WCD_debugMask = { NULL, NULL };  /* Core VxD Mask */
@@ -167,80 +161,80 @@ static u32 WCD_cRefs;
  */
 
 /* MGR wrapper functions */
-static struct WCD_Cmd mgr_cmd[] = {
-   {MGRWRAP_EnumNode_Info},/* MGR_ENUMNODE_INFO */
-   {MGRWRAP_EnumProc_Info},/* MGR_ENUMPROC_INFO */
-   {MGRWRAP_RegisterObject},   /* MGR_REGISTEROBJECT */
-   {MGRWRAP_UnregisterObject}, /* MGR_UNREGISTEROBJECT */
-   {MGRWRAP_WaitForBridgeEvents},  /* MGR_WAIT */
+static u32 (*mgr_cmd[])(union Trapped_Args *args, void *pr_ctxt) = {
+   MGRWRAP_EnumNode_Info,  /* MGR_ENUMNODE_INFO */
+   MGRWRAP_EnumProc_Info,  /* MGR_ENUMPROC_INFO */
+   MGRWRAP_RegisterObject, /* MGR_REGISTEROBJECT */
+   MGRWRAP_UnregisterObject,   /* MGR_UNREGISTEROBJECT */
+   MGRWRAP_WaitForBridgeEvents,/* MGR_WAIT */
 #ifndef RES_CLEANUP_DISABLE
-   {MGRWRAP_GetProcessResourcesInfo},  /* MGR_GET_PROC_RES */
+   MGRWRAP_GetProcessResourcesInfo,/* MGR_GET_PROC_RES */
 #else
-   {NULL},
+   NULL,
 #endif
 };
 
 /* PROC wrapper functions */
-static struct WCD_Cmd proc_cmd[] = {
-   {PROCWRAP_Attach},  /* PROC_ATTACH */
-   {PROCWRAP_Ctrl},/* PROC_CTRL */
-   {PROCWRAP_Detach},  /* PROC_DETACH */
-   {PROCWRAP_EnumNode_Info},   /* PROC_ENUMNODE */
-   {PROCWRAP_EnumResources},   /* PROC_ENUMRESOURCES */
-   {PROCWRAP_GetState},/* PROC_GET_STATE */
-   {PROCWRAP_GetTrace},/* PROC_GET_TRACE */
-   {PROCWRAP_Load},/* PROC_LOAD */
-   {PROCWRAP_RegisterNotify},  /* PROC_REGISTERNOTIFY */
-   {PROCWRAP_Start},   /* PROC_START */
-   {PROCWRAP_ReserveMemory},   /* PROC_RSVMEM */
-   {PROCWRAP_UnReserveMemory}, /* PROC_UNRSVMEM */
-   {PROCWRAP_Map}, /* PROC_MAPMEM */
-   {PROCWRAP_UnMap},   /* PROC_UNMAPMEM */
-   {PROCWRAP_FlushMemory}, /* PROC_FLUSHMEMORY */
-   {PROCWRAP_Stop},/* PROC_STOP */
-   {PROCWRAP_InvalidateMemory},/* PROC_INVALIDATEMEMORY */
+static u32 (*proc_cmd[])(union Trapped_Args *args, void *pr_ctxt) = {
+   PROCWRAP_Attach,/* PROC_ATTACH */
+   PROCWRAP_Ctrl,  /* PROC_CTRL */
+   PROCWRAP_Detach,/* PROC_DETACH */
+   PROCWRAP_EnumNode_Info, /* PROC_ENUMNODE */
+   PROCWRAP_EnumResources, /* PROC_ENUMRESOURCES */
+   PROCWRAP_GetState,  /* PROC_GET_STATE */
+   PROCWRAP_GetTrace,  /* PROC_GET_TRACE */
+   PROCWRAP_Load,  /* PROC_LOAD */
+   PROCWRAP_RegisterNotify,/* PROC_REGISTERNOTIFY */
+   PROCWRAP_Start, /* PROC_START */
+   PROCWRAP_ReserveMemory, /* PROC_RSVMEM */
+   PROCWRAP_UnReserveMemory,   /* PROC_UNRSVMEM */
+   PROCWRAP_Map,   /* PROC_MAPMEM */
+   PROCWRAP_UnMap, /* PROC_UNMAPMEM */
+   PROCWRAP_FlushMemory,   /* PROC_FLUSHMEMORY */
+   PROCWRAP_Stop,  /* PROC_STOP */
+   PROCWRAP_InvalidateMemory,  /* PROC_INVALIDATEMEMORY */
 };
 
 /* NODE wrapper functions */
-static struct WCD_Cmd node_cmd[] = {
-   {NODEWRAP_Allocate},/* NODE_ALLOCATE */
-   {NODEWRAP_AllocMsgBuf}, /* NODE_ALLOCMSGBUF */
-   {NODEWRAP_ChangePriority},  /* NODE_CHANGEPRIORITY */
-

Re: [PATCH v3 7/7] DSPBRIDGE: remove WCD_Cmd structure

2010-01-11 Thread Nishanth Menon

Ramirez Luna, Omar had written, on 01/11/2010 07:00 PM, the following:

Remove WCD_Cmd structure given that only one member is being
used (fxn call), this structure is replaced for a definition
of an array of function pointers for each dspbridge ioctl
module.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
CC: Nishanth Menon n...@ti.com
CC: Hiroshi Doyu hiroshi.d...@nokia.com
CC: Ameya Palande ameya.pala...@nokia.com
CC: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/dsp/bridge/pmgr/wcd.c |  134 +++-
 1 files changed, 64 insertions(+), 70 deletions(-)

diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c
index 27e8e8e..37d1f8a 100644
--- a/drivers/dsp/bridge/pmgr/wcd.c
+++ b/drivers/dsp/bridge/pmgr/wcd.c
@@ -147,12 +147,6 @@
 /* Used to get dspbridge ioctl table */
 #define DB_GET_IOC_TABLE(cmd)  (DB_GET_MODULE(cmd)  DB_MODULE_SHIFT)
 
-/* Device IOCtl function pointer */

-struct WCD_Cmd {
-   u32(*fxn)(union Trapped_Args *args, void *pr_ctxt);
-   u32 dwIndex;
-} ;
-
 /*  --- Globals */
 #if GT_TRACE
 static struct GT_Mask WCD_debugMask = { NULL, NULL };  /* Core VxD Mask */
@@ -167,80 +161,80 @@ static u32 WCD_cRefs;
  */
 
 /* MGR wrapper functions */

-static struct WCD_Cmd mgr_cmd[] = {
-   {MGRWRAP_EnumNode_Info},/* MGR_ENUMNODE_INFO */
-   {MGRWRAP_EnumProc_Info},/* MGR_ENUMPROC_INFO */
-   {MGRWRAP_RegisterObject},   /* MGR_REGISTEROBJECT */
-   {MGRWRAP_UnregisterObject}, /* MGR_UNREGISTEROBJECT */
-   {MGRWRAP_WaitForBridgeEvents},  /* MGR_WAIT */
+static u32 (*mgr_cmd[])(union Trapped_Args *args, void *pr_ctxt) = {


agreed that we dont need dwIndex anymore and struct wrapper is an 
overhead, but, just being a nitpick again, but is'nt typedef a necessary 
evil at this point to ensure that all cmd_ function pointers are of the 
same style for each of the arrays?


--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html