diff mbox

[DSPBRIGDE,1/6] dsp: bridge: use ARRAY_SIZE

Message ID 1250850219-25545-2-git-send-email-felipe.balbi@nokia.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Felipe Balbi Aug. 21, 2009, 10:23 a.m. UTC
trivial patch using ARRAY_SIZE.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 drivers/dsp/bridge/pmgr/wcd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c
index 859043d..7434f43 100644
--- a/drivers/dsp/bridge/pmgr/wcd.c
+++ b/drivers/dsp/bridge/pmgr/wcd.c
@@ -256,7 +256,7 @@  static struct WCD_Cmd WCD_cmdTable[] = {
 inline DSP_STATUS WCD_CallDevIOCtl(u32 cmd, union Trapped_Args *args,
 				    u32 *pResult)
 {
-	if ((cmd < (sizeof(WCD_cmdTable) / sizeof(struct WCD_Cmd)))) {
+	if (cmd < ARRAY_SIZE(WCD_cmdTable)) {
 		/* make the fxn call via the cmd table */
 		*pResult = (*WCD_cmdTable[cmd].fxn) (args);
 		return DSP_SOK;
@@ -307,7 +307,7 @@  bool WCD_Init(void)
 #ifdef DEBUG
 	/* runtime check of Device IOCtl array. */
 	u32 i;
-	for (i = 1; i < (sizeof(WCD_cmdTable) / sizeof(struct WCD_Cmd)); i++)
+	for (i = 1; i < ARRAY_SIZE(WCD_cmdTable); i++)
 		DBC_Assert(WCD_cmdTable[i - 1].dwIndex == i);
 
 #endif