[v4,3/7] graph: fix missing explicit cast for C++ build

Message ID 20220210154239.587185-4-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series Verify C++ compatibility of public headers |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Feb. 10, 2022, 3:42 p.m. UTC
  C++ does not have automatic casting to/from void pointers, so need
explicit cast if header is to be included in C++ code

Fixes: 40d4f51403ec ("graph: implement fastpath routines")
Cc: jerinj@marvell.com
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/graph/rte_graph_worker.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/lib/graph/rte_graph_worker.h b/lib/graph/rte_graph_worker.h
index eef77f732a..0c0b9c095a 100644
--- a/lib/graph/rte_graph_worker.h
+++ b/lib/graph/rte_graph_worker.h
@@ -155,7 +155,7 @@  rte_graph_walk(struct rte_graph *graph)
 	 *	+-----+ <= cir_start + mask
 	 */
 	while (likely(head != graph->tail)) {
-		node = RTE_PTR_ADD(graph, cir_start[(int32_t)head++]);
+		node = (struct rte_node *)RTE_PTR_ADD(graph, cir_start[(int32_t)head++]);
 		RTE_ASSERT(node->fence == RTE_GRAPH_FENCE);
 		objs = node->objs;
 		rte_prefetch0(objs);