trivial patch using ARRAY_SIZE.

Signed-off-by: Felipe Balbi <[email protected]>
---
 drivers/dsp/bridge/pmgr/wcd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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
-- 
1.6.3.3.385.g60647

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to