[dpdk-test-report] |WARNING| pw29341 [PATCH v3 01/24] net/bnxt: fix HWRM_*() macros and locking

checkpatch at dpdk.org checkpatch at dpdk.org
Thu Sep 28 16:13:49 CEST 2017


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

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'req' - possible side-effects?
#75: FILE: drivers/net/bnxt/bnxt_hwrm.c:185:
+#define HWRM_PREP(req, type) do { \
+	rte_spinlock_lock(&bp->hwrm_lock); \
 	memset(bp->hwrm_cmd_resp_addr, 0, bp->max_resp_len); \
 	req.req_type = rte_cpu_to_le_16(HWRM_##type); \
+	req.cmpl_ring = rte_cpu_to_le_16(-1); \
 	req.seq_id = rte_cpu_to_le_16(bp->hwrm_cmd_seq++); \
 	req.target_id = rte_cpu_to_le_16(0xffff); \
+	req.resp_addr = rte_cpu_to_le_64(bp->hwrm_cmd_resp_dma_addr); \
+} while (0)

WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#94: FILE: drivers/net/bnxt/bnxt_hwrm.c:195:
+#define HWRM_CHECK_RESULT() do {\
+	if (rc) { \
+		RTE_LOG(ERR, PMD, "%s failed rc:%d
", \
+			__func__, rc); \
+		rte_spinlock_unlock(&bp->hwrm_lock); \
+		return rc; \
+	} \
+	if (resp->error_code) { \
+		rc = rte_le_to_cpu_16(resp->error_code); \
+		if (resp->resp_len >= 16) { \
+			struct hwrm_err_output *tmp_hwrm_err_op = \
+						(void *)resp; \
+			RTE_LOG(ERR, PMD, \
+				"%s error %d:%d:%08x:%04x
", \
+				__func__, \
+				rc, tmp_hwrm_err_op->cmd_err, \
+				rte_le_to_cpu_32(\
+					tmp_hwrm_err_op->opaque_0), \
+				rte_le_to_cpu_16(\
+					tmp_hwrm_err_op->opaque_1)); \
 		} \
+		else { \
+			RTE_LOG(ERR, PMD, \
+				"%s error %d
", __func__, rc); \
 		} \
+		rte_spinlock_unlock(&bp->hwrm_lock); \
+		return rc; \
+	} \
+} while (0)

total: 0 errors, 1 warnings, 1 checks, 1295 lines checked


More information about the test-report mailing list