@@ -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
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(-)