Skip to contentSkip to conversation

test: fix incorrect cast in distributor unit test

PATCH Applied David Hunt 3 participants 3 messages May 10, 2018 – May 13, 2018

lore
Share & tools
lore

David Hunt

author
#0 lore raw

PATCH 1/1 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")
---
 test/test/test_distributor_perf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
test/test/test_distributor_perf.c +2 -1
index 557715e13..edf1998ab 100644
@@ -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;
 }
 
 /*
Signature · 1 line
2.17.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Hunt
Sent: Thursday, May 10, 2018 2:26 AM
To: [email protected]
Cc: Richardson, Bruce <[email protected]>; Hunt, David <[email protected]>
Subject: [dpdk-dev] [PATCH] test: fix incorrect cast in distributor unit test

Quoted 8 lines

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")
#2 lore raw
Quoted 5 lines
Quoted 5 lines

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.

Quoted 7 lines
Quoted 3 lines
Fixes c3eabff124e6 ("distributor: add unit tests")

Applied, thanks