Fix the logic for the case of event queue allowing all schedule types.
Compiler warning pointing to this error (with LTO enabled):
error: ‘sched_type’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
if ((ret < 0 && ret != -EOVERFLOW) ||
Fixes:
6750b21bd6af ("eventdev: add default software timer adapter")
Cc: stable@dpdk.org
Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE,
&sched_type);
- if ((ret < 0 && ret != -EOVERFLOW) ||
- evtim->ev.sched_type != sched_type)
- return -1;
+ if ((ret == 0 && evtim->ev.sched_type == sched_type) ||
+ ret == -EOVERFLOW)
+ return 0;
- return 0;
+ return -1;
}
static int