Skip to contentSkip to conversation

test: fix incorrect cast in pipeline unit test

PATCH Applied David Hunt 4 participants 4 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 pipeline unit test

New warning with gcc 8.1:
The table_action_stub_miss() function was incorrectly declared as returning a typedef of rte_pipeline_table_action_handler_miss, instead of what it should have been, an int.
Changed this to declare the function as returning an int, and now when the action_handler_miss is set to table_action_stub_miss (cast as rte_pipeline_table_action_handler_miss), gcc 8.1 no longer complains about the cast.

Fixes 5205954791cb ("app/test: packet framework unit tests")
---
 test/test/test_table_pipeline.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
test/test/test_table_pipeline.c +2 -2
index 055a1a4e7..5ec4c5244 100644
@@ -69,7 +69,7 @@ rte_pipeline_table_action_handler_hit
 table_action_stub_hit(struct rte_pipeline *p, struct rte_mbuf **pkts,
 	uint64_t pkts_mask, struct rte_pipeline_table_entry **entry, void *arg);
 
-rte_pipeline_table_action_handler_miss
+static int
 table_action_stub_miss(struct rte_pipeline *p, struct rte_mbuf **pkts,
 	uint64_t pkts_mask, struct rte_pipeline_table_entry **entry, void *arg);
 
@@ -101,7 +101,7 @@ table_action_stub_hit(__attribute__((unused)) struct rte_pipeline *p,
 	return 0;
 }
 
-rte_pipeline_table_action_handler_miss
+static int
 table_action_stub_miss(struct rte_pipeline *p,
 	__attribute__((unused)) struct rte_mbuf **pkts,
 	uint64_t pkts_mask,
Signature · 1 line
2.17.0
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 17 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Hunt
Sent: Thursday, May 10, 2018 8:38 AM
To: [email protected]
Cc: Dumitrescu, Cristian <[email protected]>; Hunt, David <[email protected]>
Subject: [dpdk-dev] [PATCH] test: fix incorrect cast in pipeline unit test

New warning with gcc 8.1:
The table_action_stub_miss() function was incorrectly declared as returning a typedef of rte_pipeline_table_action_handler_miss, instead of what it should have been, an int.
Changed this to declare the function as returning an int, and now when the action_handler_miss is set to table_action_stub_miss (cast as rte_pipeline_table_action_handler_miss), gcc 8.1 no longer complains about the cast.

Quoted 3 lines
Fixes 5205954791cb ("app/test: packet framework unit tests")

Looks ok to me.

Acked-by on v1 1/1
#2 lore raw
In reply to David Hunt
Quoted 19 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Hunt
Sent: Thursday, May 10, 2018 8:38 AM
To: [email protected]
Cc: Dumitrescu, Cristian <[email protected]>; Hunt, David <[email protected]>
Subject: [dpdk-dev] [PATCH] test: fix incorrect cast in pipeline unit test

New warning with gcc 8.1:
The table_action_stub_miss() function was incorrectly declared as returning a typedef of rte_pipeline_table_action_handler_miss, instead of what it should have been, an int.
Changed this to declare the function as returning an int, and now when the action_handler_miss is set to table_action_stub_miss (cast as rte_pipeline_table_action_handler_miss), gcc 8.1 no longer complains about the cast.

Quoted 3 lines
Fixes 5205954791cb ("app/test: packet framework unit tests")

Missing "Cc: [email protected]".

#3 lore raw
Quoted 9 lines
Quoted 9 lines

New warning with gcc 8.1:
The table_action_stub_miss() function was incorrectly declared as returning a typedef of rte_pipeline_table_action_handler_miss, instead of what it should have been, an int.
Changed this to declare the function as returning an int, and now when the action_handler_miss is set to table_action_stub_miss (cast as rte_pipeline_table_action_handler_miss), gcc 8.1 no longer complains about the cast.

Quoted 7 lines
Quoted 3 lines
Fixes 5205954791cb ("app/test: packet framework unit tests")

Missing "Cc: [email protected]".

Applied, thanks