|WARNING| pw137508 [PATCH 1/2] net/mlx5: remove code duplications

checkpatch at dpdk.org checkpatch at dpdk.org
Thu Feb 29 17:06:53 CET 2024


Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/137508

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'i' - possible side-effects?
#145: FILE: drivers/net/mlx5/mlx5_flow_dv.c:7495:
+#define MLX5_L3_NEXT_PROTOCOL(i, ms)                                            \
+	((i)->type == RTE_FLOW_ITEM_TYPE_IPV4 ?                                  \
+	((const struct rte_flow_item_ipv4 *)(i)->ms)->hdr.next_proto_id :       \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6 ?                                  \
+	((const struct rte_flow_item_ipv6 *)(i)->ms)->hdr.proto :               \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT ?                         \
+	((const struct rte_flow_item_ipv6_frag_ext *)(i)->ms)->hdr.next_header :\
+	0xff)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ms' - possible side-effects?
#145: FILE: drivers/net/mlx5/mlx5_flow_dv.c:7495:
+#define MLX5_L3_NEXT_PROTOCOL(i, ms)                                            \
+	((i)->type == RTE_FLOW_ITEM_TYPE_IPV4 ?                                  \
+	((const struct rte_flow_item_ipv4 *)(i)->ms)->hdr.next_proto_id :       \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6 ?                                  \
+	((const struct rte_flow_item_ipv6 *)(i)->ms)->hdr.proto :               \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT ?                         \
+	((const struct rte_flow_item_ipv6_frag_ext *)(i)->ms)->hdr.next_header :\
+	0xff)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'ms' may be better as '(ms)' to avoid precedence issues
#145: FILE: drivers/net/mlx5/mlx5_flow_dv.c:7495:
+#define MLX5_L3_NEXT_PROTOCOL(i, ms)                                            \
+	((i)->type == RTE_FLOW_ITEM_TYPE_IPV4 ?                                  \
+	((const struct rte_flow_item_ipv4 *)(i)->ms)->hdr.next_proto_id :       \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6 ?                                  \
+	((const struct rte_flow_item_ipv6 *)(i)->ms)->hdr.proto :               \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT ?                         \
+	((const struct rte_flow_item_ipv6_frag_ext *)(i)->ms)->hdr.next_header :\
+	0xff)

total: 0 errors, 0 warnings, 3 checks, 193 lines checked


More information about the test-report mailing list