Skip to content

Commit

Permalink
event/cnxk: fix variables casting
Browse files Browse the repository at this point in the history
[ upstream commit 8948515 ]

Fix incompatible casting on variables reported by coverity scan.

Coverity issue: 370582 370584
Fixes: 6223ede ("event/cnxk: add event port link and unlink")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
  • Loading branch information
Gowrishankar Muthukrishnan authored and kevintraynor committed Feb 28, 2022
1 parent 9a55242 commit 52d824d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions drivers/event/cnxk/cn10k_eventdev.c
Expand Up @@ -111,10 +111,10 @@ cn10k_sso_hws_release(void *arg, void *hws)
{
struct cnxk_sso_evdev *dev = arg;
struct cn10k_sso_hws *ws = hws;
int i;
uint16_t i;

for (i = 0; i < dev->nb_event_queues; i++)
roc_sso_hws_unlink(&dev->sso, ws->hws_id, (uint16_t *)&i, 1);
roc_sso_hws_unlink(&dev->sso, ws->hws_id, &i, 1);
memset(ws, 0, sizeof(*ws));
}

Expand Down
11 changes: 4 additions & 7 deletions drivers/event/cnxk/cn9k_eventdev.c
Expand Up @@ -109,24 +109,21 @@ cn9k_sso_hws_release(void *arg, void *hws)
struct cnxk_sso_evdev *dev = arg;
struct cn9k_sso_hws_dual *dws;
struct cn9k_sso_hws *ws;
int i;
uint16_t i;

if (dev->dual_ws) {
dws = hws;
for (i = 0; i < dev->nb_event_queues; i++) {
roc_sso_hws_unlink(&dev->sso,
CN9K_DUAL_WS_PAIR_ID(dws->hws_id, 0),
(uint16_t *)&i, 1);
CN9K_DUAL_WS_PAIR_ID(dws->hws_id, 0), &i, 1);
roc_sso_hws_unlink(&dev->sso,
CN9K_DUAL_WS_PAIR_ID(dws->hws_id, 1),
(uint16_t *)&i, 1);
CN9K_DUAL_WS_PAIR_ID(dws->hws_id, 1), &i, 1);
}
memset(dws, 0, sizeof(*dws));
} else {
ws = hws;
for (i = 0; i < dev->nb_event_queues; i++)
roc_sso_hws_unlink(&dev->sso, ws->hws_id,
(uint16_t *)&i, 1);
roc_sso_hws_unlink(&dev->sso, ws->hws_id, &i, 1);
memset(ws, 0, sizeof(*ws));
}
}
Expand Down

0 comments on commit 52d824d

Please sign in to comment.