[1/3] event/cnxk: fix incompatible casting of variables
Checks
Commit Message
Fix incompatible casting on variables reported by coverity scan.
Fixes: 6223ede2036 ("event/cnxk: add event port link and unlink")
Coverity issue: 370582 370584
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
drivers/event/cnxk/cn10k_eventdev.c | 4 ++--
drivers/event/cnxk/cn9k_eventdev.c | 11 ++++-------
2 files changed, 6 insertions(+), 9 deletions(-)
Comments
On Sat, Feb 12, 2022 at 6:10 PM Gowrishankar Muthukrishnan
<gmuthukrishn@marvell.com> wrote:
>
> Fix incompatible casting on variables reported by coverity scan.
Series applied to dpdk-next-net-eventdev/for-main. Thanks
>
> Fixes: 6223ede2036 ("event/cnxk: add event port link and unlink")
> Coverity issue: 370582 370584
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
> drivers/event/cnxk/cn10k_eventdev.c | 4 ++--
> drivers/event/cnxk/cn9k_eventdev.c | 11 ++++-------
> 2 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c
> index 7b7ce44c74..2bcf5066c4 100644
> --- a/drivers/event/cnxk/cn10k_eventdev.c
> +++ b/drivers/event/cnxk/cn10k_eventdev.c
> @@ -98,10 +98,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));
> }
>
> diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c
> index 4611936b7f..3413467edc 100644
> --- a/drivers/event/cnxk/cn9k_eventdev.c
> +++ b/drivers/event/cnxk/cn9k_eventdev.c
> @@ -97,24 +97,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));
> }
> }
> --
> 2.25.1
>
@@ -98,10 +98,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));
}
@@ -97,24 +97,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));
}
}