DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eventdev: fix icc build
@ 2018-04-17 13:13 Pablo de Lara
  2018-04-17 13:28 ` Ferruh Yigit
  2018-04-17 14:13 ` Carrillo, Erik G
  0 siblings, 2 replies; 4+ messages in thread
From: Pablo de Lara @ 2018-04-17 13:13 UTC (permalink / raw)
  To: jerin.jacob, erik.g.carrillo; +Cc: dev, Pablo de Lara

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>
---
 lib/librte_eventdev/rte_event_timer_adapter.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 6eba6b44d..9a863f5cb 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -695,7 +695,7 @@ check_destination_event_queue(struct rte_event_timer *evtim,
 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;
@@ -705,8 +705,6 @@ sw_event_timer_adapter_service_func(void *arg)
 	struct rte_timer *tim = NULL;
 	struct msg *msg, *msgs[NB_OBJS];
 
-	RTE_SET_USED(ret);
-
 	adapter = arg;
 	sw_data = adapter->data->adapter_priv;
 
@@ -720,6 +718,10 @@ sw_event_timer_adapter_service_func(void *arg)
 						  (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;
 
-- 
2.14.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] eventdev: fix icc build
  2018-04-17 13:13 [dpdk-dev] [PATCH] eventdev: fix icc build Pablo de Lara
@ 2018-04-17 13:28 ` Ferruh Yigit
  2018-04-17 14:13 ` Carrillo, Erik G
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-04-17 13:28 UTC (permalink / raw)
  To: Pablo de Lara, jerin.jacob, erik.g.carrillo; +Cc: dev

On 4/17/2018 2:13 PM, Pablo de Lara wrote:
> 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] eventdev: fix icc build
  2018-04-17 13:13 [dpdk-dev] [PATCH] eventdev: fix icc build Pablo de Lara
  2018-04-17 13:28 ` Ferruh Yigit
@ 2018-04-17 14:13 ` Carrillo, Erik G
  2018-04-19 11:30   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Carrillo, Erik G @ 2018-04-17 14:13 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, jerin.jacob; +Cc: dev

> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Tuesday, April 17, 2018 8:14 AM
> To: jerin.jacob@caviumnetworks.com; Carrillo, Erik G
> <erik.g.carrillo@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [PATCH] eventdev: fix icc build
> 
> 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: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] eventdev: fix icc build
  2018-04-17 14:13 ` Carrillo, Erik G
@ 2018-04-19 11:30   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-04-19 11:30 UTC (permalink / raw)
  To: De Lara Guarch, Pablo; +Cc: dev, Carrillo, Erik G, jerin.jacob, ferruh.yigit

> > 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: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-19 11:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 13:13 [dpdk-dev] [PATCH] eventdev: fix icc build Pablo de Lara
2018-04-17 13:28 ` Ferruh Yigit
2018-04-17 14:13 ` Carrillo, Erik G
2018-04-19 11:30   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).