[dpdk-dev] test: fix incorrect cast in distributor unit test

Message ID 20180510012538.176757-1-david.hunt@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hunt, David May 10, 2018, 1:25 a.m. UTC
  New warning with gcc 8.1:
When casting the function pointer passed to
rte_eal_remote_launch() as an lcore_function_t *,
it expects the cast function to return an int, but
instead it was returning void. Fixed to return
an int.

Fixes: c3eabff124e6 ("distributor: add unit tests")

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 test/test/test_distributor_perf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

De Lara Guarch, Pablo May 10, 2018, 3:59 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Hunt
> Sent: Thursday, May 10, 2018 2:26 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Hunt, David
> <david.hunt@intel.com>
> Subject: [dpdk-dev] [PATCH] test: fix incorrect cast in distributor unit test
> 
> New warning with gcc 8.1:
> When casting the function pointer passed to
> rte_eal_remote_launch() as an lcore_function_t *, it expects the cast function
> to return an int, but instead it was returning void. Fixed to return an int.
> 
> Fixes: c3eabff124e6 ("distributor: add unit tests")
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>

Cc: stable@dpdk.org

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
Thomas Monjalon May 13, 2018, 9:04 p.m. UTC | #2
> > New warning with gcc 8.1:
> > When casting the function pointer passed to
> > rte_eal_remote_launch() as an lcore_function_t *, it expects the cast function
> > to return an int, but instead it was returning void. Fixed to return an int.
> > 
> > Fixes: c3eabff124e6 ("distributor: add unit tests")
> > 
> > Signed-off-by: David Hunt <david.hunt@intel.com>
> 
> Cc: stable@dpdk.org
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks
  

Patch

diff --git a/test/test/test_distributor_perf.c b/test/test/test_distributor_perf.c
index 557715e13..edf1998ab 100644
--- a/test/test/test_distributor_perf.c
+++ b/test/test/test_distributor_perf.c
@@ -31,7 +31,7 @@  struct worker_stats worker_stats[RTE_MAX_LCORE];
  * worker thread used for testing the time to do a round-trip of a cache
  * line between two cores and back again
  */
-static void
+static int
 flip_bit(volatile uint64_t *arg)
 {
 	uint64_t old_val = 0;
@@ -41,6 +41,7 @@  flip_bit(volatile uint64_t *arg)
 		old_val = *arg;
 		*arg = 0;
 	}
+	return 0;
 }
 
 /*