ICC complains about variable being used before its value is set.
Since the variable is only assigned in the for loop,
its declaration is moved inside and is initialized.
lib/librte_eventdev/rte_event_timer_adapter.c(708): error #592:
variable "ret" is used before its value is set
RTE_SET_USED(ret);
Fixes:
6750b21bd6af ("eventdev: add default software timer adapter")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
static int
sw_event_timer_adapter_service_func(void *arg)
{
- int ret, i, num_msgs;
+ int i, num_msgs;
uint64_t cycles, opaque;
uint16_t nb_evs_flushed = 0;
uint16_t nb_evs_invalid = 0;
struct rte_timer *tim = NULL;
struct msg *msg, *msgs[NB_OBJS];
- RTE_SET_USED(ret);
-
adapter = arg;
sw_data = adapter->data->adapter_priv;
(void **)msgs, NB_OBJS, NULL);
for (i = 0; i < num_msgs; i++) {
+ int ret = 0;
+
+ RTE_SET_USED(ret);
+
msg = msgs[i];
evtim = msg->evtim;