[dpdk-test-report] |WARNING| pw66862 [PATCH v1 13/32] eal/trace: implement provider payload

checkpatch at dpdk.org checkpatch at dpdk.org
Wed Mar 18 20:04:48 CET 2020


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

_coding style issues_


WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#153: FILE: lib/librte_eal/common/include/rte_trace_provider.h:92:
+#define __rte_trace_emit_header_generic(t)\
+	const uint64_t val = __atomic_load_n(t, __ATOMIC_ACQUIRE);\
+	if (likely(!(val & __RTE_TRACE_FIELD_ENABLE_MASK)))\
+		return;\
+	void *mem = __rte_trace_mem_get(val);\
+	if (unlikely(mem == NULL)) \
+		return;\
+	mem = __rte_trace_emit_ev_header(mem, val)

ERROR:MULTISTATEMENT_MACRO_USE_DO_WHILE: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
#162: FILE: lib/librte_eal/common/include/rte_trace_provider.h:101:
+#define __rte_trace_emit_header_dp(t)\
+	if (!rte_trace_is_dp_enabled())\
+		return;\
+	__rte_trace_emit_header_generic(t);

WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#162: FILE: lib/librte_eal/common/include/rte_trace_provider.h:101:
+#define __rte_trace_emit_header_dp(t)\
+	if (!rte_trace_is_dp_enabled())\
+		return;\
+	__rte_trace_emit_header_generic(t);

WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon
#162: FILE: lib/librte_eal/common/include/rte_trace_provider.h:101:
+#define __rte_trace_emit_header_dp(t)\
+	if (!rte_trace_is_dp_enabled())\
+		return;\
+	__rte_trace_emit_header_generic(t);

ERROR:MULTISTATEMENT_MACRO_USE_DO_WHILE: Macros with multiple statements should be enclosed in a do - while loop
#167: FILE: lib/librte_eal/common/include/rte_trace_provider.h:106:
+#define __rte_trace_emit_datatype(in)\
+	memcpy(mem, &(in), sizeof(in));\
+	mem = RTE_PTR_ADD(mem, sizeof(in))

ERROR:MULTISTATEMENT_MACRO_USE_DO_WHILE: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
#185: FILE: lib/librte_eal/common/include/rte_trace_provider.h:124:
+#define rte_trace_ctf_string(in)\
+	if (unlikely(in == NULL))\
+		return;\
+	rte_strscpy(mem, in, __RTE_TRACE_EMIT_STRING_LEN_MAX);\
+	mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX)

WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#185: FILE: lib/librte_eal/common/include/rte_trace_provider.h:124:
+#define rte_trace_ctf_string(in)\
+	if (unlikely(in == NULL))\
+		return;\
+	rte_strscpy(mem, in, __RTE_TRACE_EMIT_STRING_LEN_MAX);\
+	mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX)

total: 3 errors, 4 warnings, 97 lines checked


More information about the test-report mailing list