From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: linux-omap <linux-omap@vger.kernel.org>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>,
Nishanth Menon <nm@ti.com>, Hiroshi Doyu <Hiroshi.DOYU@nokia.com>,
Ameya Palande <ameya.palande@nokia.com>,
Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH v3 7/7] DSPBRIDGE: remove WCD_Cmd structure
Date: Mon, 11 Jan 2010 19:00:41 -0600 [thread overview]
Message-ID: <1263258041-16836-8-git-send-email-omar.ramirez@ti.com> (raw)
In-Reply-To: <1263258041-16836-7-git-send-email-omar.ramirez@ti.com>
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.ramirez@ti.com>
CC: Nishanth Menon <nm@ti.com>
CC: Hiroshi Doyu <Hiroshi.DOYU@nokia.com>
CC: Ameya Palande <ameya.palande@nokia.com>
CC: Felipe Contreras <felipe.contreras@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 */
- {NODEWRAP_Connect}, /* NODE_CONNECT */
- {NODEWRAP_Create}, /* NODE_CREATE */
- {NODEWRAP_Delete}, /* NODE_DELETE */
- {NODEWRAP_FreeMsgBuf}, /* NODE_FREEMSGBUF */
- {NODEWRAP_GetAttr}, /* NODE_GETATTR */
- {NODEWRAP_GetMessage}, /* NODE_GETMESSAGE */
- {NODEWRAP_Pause}, /* NODE_PAUSE */
- {NODEWRAP_PutMessage}, /* NODE_PUTMESSAGE */
- {NODEWRAP_RegisterNotify}, /* NODE_REGISTERNOTIFY */
- {NODEWRAP_Run}, /* NODE_RUN */
- {NODEWRAP_Terminate}, /* NODE_TERMINATE */
- {NODEWRAP_GetUUIDProps}, /* NODE_GETUUIDPROPS */
+static u32 (*node_cmd[])(union Trapped_Args *args, void *pr_ctxt) = {
+ NODEWRAP_Allocate, /* NODE_ALLOCATE */
+ NODEWRAP_AllocMsgBuf, /* NODE_ALLOCMSGBUF */
+ NODEWRAP_ChangePriority, /* NODE_CHANGEPRIORITY */
+ NODEWRAP_Connect, /* NODE_CONNECT */
+ NODEWRAP_Create, /* NODE_CREATE */
+ NODEWRAP_Delete, /* NODE_DELETE */
+ NODEWRAP_FreeMsgBuf, /* NODE_FREEMSGBUF */
+ NODEWRAP_GetAttr, /* NODE_GETATTR */
+ NODEWRAP_GetMessage, /* NODE_GETMESSAGE */
+ NODEWRAP_Pause, /* NODE_PAUSE */
+ NODEWRAP_PutMessage, /* NODE_PUTMESSAGE */
+ NODEWRAP_RegisterNotify, /* NODE_REGISTERNOTIFY */
+ NODEWRAP_Run, /* NODE_RUN */
+ NODEWRAP_Terminate, /* NODE_TERMINATE */
+ NODEWRAP_GetUUIDProps, /* NODE_GETUUIDPROPS */
};
/* STRM wrapper functions */
-static struct WCD_Cmd strm_cmd[] = {
- {STRMWRAP_AllocateBuffer}, /* STRM_ALLOCATEBUFFER */
- {STRMWRAP_Close}, /* STRM_CLOSE */
- {STRMWRAP_FreeBuffer}, /* STRM_FREEBUFFER */
- {STRMWRAP_GetEventHandle}, /* STRM_GETEVENTHANDLE */
- {STRMWRAP_GetInfo}, /* STRM_GETINFO */
- {STRMWRAP_Idle}, /* STRM_IDLE */
- {STRMWRAP_Issue}, /* STRM_ISSUE */
- {STRMWRAP_Open}, /* STRM_OPEN */
- {STRMWRAP_Reclaim}, /* STRM_RECLAIM */
- {STRMWRAP_RegisterNotify}, /* STRM_REGISTERNOTIFY */
- {STRMWRAP_Select}, /* STRM_SELECT */
+static u32 (*strm_cmd[])(union Trapped_Args *args, void *pr_ctxt) = {
+ STRMWRAP_AllocateBuffer, /* STRM_ALLOCATEBUFFER */
+ STRMWRAP_Close, /* STRM_CLOSE */
+ STRMWRAP_FreeBuffer, /* STRM_FREEBUFFER */
+ STRMWRAP_GetEventHandle, /* STRM_GETEVENTHANDLE */
+ STRMWRAP_GetInfo, /* STRM_GETINFO */
+ STRMWRAP_Idle, /* STRM_IDLE */
+ STRMWRAP_Issue, /* STRM_ISSUE */
+ STRMWRAP_Open, /* STRM_OPEN */
+ STRMWRAP_Reclaim, /* STRM_RECLAIM */
+ STRMWRAP_RegisterNotify, /* STRM_REGISTERNOTIFY */
+ STRMWRAP_Select, /* STRM_SELECT */
};
/* CMM wrapper functions */
-static struct WCD_Cmd cmm_cmd[] = {
- {CMMWRAP_CallocBuf}, /* CMM_ALLOCBUF */
- {CMMWRAP_FreeBuf}, /* CMM_FREEBUF */
- {CMMWRAP_GetHandle}, /* CMM_GETHANDLE */
- {CMMWRAP_GetInfo}, /* CMM_GETINFO */
+static u32 (*cmm_cmd[])(union Trapped_Args *args, void *pr_ctxt) = {
+ CMMWRAP_CallocBuf, /* CMM_ALLOCBUF */
+ CMMWRAP_FreeBuf, /* CMM_FREEBUF */
+ CMMWRAP_GetHandle, /* CMM_GETHANDLE */
+ CMMWRAP_GetInfo, /* CMM_GETINFO */
};
/* Array used to store ioctl table sizes. It can hold up to 8 entries */
@@ -323,19 +317,19 @@ inline DSP_STATUS WCD_CallDevIOCtl(u32 cmd, union Trapped_Args *args,
switch (DB_GET_MODULE(cmd)) {
case DB_MGR:
- ioctl_cmd = mgr_cmd[i].fxn;
+ ioctl_cmd = mgr_cmd[i];
break;
case DB_PROC:
- ioctl_cmd = proc_cmd[i].fxn;
+ ioctl_cmd = proc_cmd[i];
break;
case DB_NODE:
- ioctl_cmd = node_cmd[i].fxn;
+ ioctl_cmd = node_cmd[i];
break;
case DB_STRM:
- ioctl_cmd = strm_cmd[i].fxn;
+ ioctl_cmd = strm_cmd[i];
break;
case DB_CMM:
- ioctl_cmd = cmm_cmd[i].fxn;
+ ioctl_cmd = cmm_cmd[i];
break;
}
--
1.6.2.4
next prev parent reply other threads:[~2010-01-12 0:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 1:00 [PATCH v3 0/7] misc patches (for ioctl and ssi) Omar Ramirez Luna
2010-01-12 1:00 ` [PATCH v3 1/7] DSPBRIDGE: replace IO_ADDRESS with ioremap Omar Ramirez Luna
2010-01-12 1:00 ` [PATCH v3 2/7] DSPBRIDGE: Replace magic numbers in SSI configuration Omar Ramirez Luna
2010-01-12 1:00 ` [PATCH v3 3/7] DSPBRIDGE: Mark unused ioctls as deprecated Omar Ramirez Luna
2010-01-12 1:00 ` [PATCH v3 4/7] DSPBRIDGE: remove ioctl runtime check Omar Ramirez Luna
2010-01-12 1:00 ` [PATCH v3 5/7] DSPBRIDGE: Rename pResult to result for WCD_CallDevIOCtl Omar Ramirez Luna
2010-01-12 1:00 ` [PATCH v3 6/7] DSPBRIDGE: Use _IOxx macro to define ioctls Omar Ramirez Luna
2010-01-12 1:00 ` Omar Ramirez Luna [this message]
2010-01-12 1:09 ` [PATCH v3 7/7] DSPBRIDGE: remove WCD_Cmd structure Nishanth Menon
2010-01-12 1:09 ` [RESEND][PATCH v3 6/7] DSPBRIDGE: Use _IOxx macro to define ioctls Ramirez Luna, Omar
2010-01-14 0:24 ` [PATCH " Ramirez Luna, Omar
2010-01-14 0:23 ` [PATCH v3 5/7] DSPBRIDGE: Rename pResult to result for WCD_CallDevIOCtl Ramirez Luna, Omar
2010-01-14 0:23 ` [PATCH v3 4/7] DSPBRIDGE: remove ioctl runtime check Ramirez Luna, Omar
2010-01-14 0:23 ` [PATCH v3 3/7] DSPBRIDGE: Mark unused ioctls as deprecated Ramirez Luna, Omar
2010-01-14 0:22 ` [PATCH v3 2/7] DSPBRIDGE: Replace magic numbers in SSI configuration Ramirez Luna, Omar
2010-01-13 23:57 ` [PATCH v3 1/7] DSPBRIDGE: replace IO_ADDRESS with ioremap Ramirez Luna, Omar
2010-01-15 13:06 ` [PATCH v3 0/7] misc patches (for ioctl and ssi) Ameya Palande
2010-01-16 2:04 ` Ramirez Luna, Omar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263258041-16836-8-git-send-email-omar.ramirez@ti.com \
--to=omar.ramirez@ti.com \
--cc=Hiroshi.DOYU@nokia.com \
--cc=ameya.palande@nokia.com \
--cc=felipe.contreras@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox