[dpdk-test-report] |WARNING| pw53565 [PATCH 07/11] net/hinic/base: add various headers

checkpatch at dpdk.org checkpatch at dpdk.org
Tue May 21 10:12:35 CEST 2019


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

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'Y' - possible side-effects?
#121: FILE: drivers/net/hinic/base/hinic_compat.h:78:
+#define DIV_ROUND_UP(X, Y) (((X) + ((Y) - 1)) / (Y))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'Y' - possible side-effects?
#124: FILE: drivers/net/hinic/base/hinic_compat.h:81:
+#define ROUND_UP(X, Y) (DIV_ROUND_UP(X, Y) * (Y))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'member' - possible side-effects?
#130: FILE: drivers/net/hinic/base/hinic_compat.h:87:
+#define container_of(ptr, type, member) ({ \
+		typeof(((type *)0)->member)(*__mptr) = (ptr); \
+		(type *)((char *)__mptr - offsetof(type, member)); })

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'member' may be better as '(member)' to avoid precedence issues
#130: FILE: drivers/net/hinic/base/hinic_compat.h:87:
+#define container_of(ptr, type, member) ({ \
+		typeof(((type *)0)->member)(*__mptr) = (ptr); \
+		(type *)((char *)__mptr - offsetof(type, member)); })

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#143: FILE: drivers/net/hinic/base/hinic_compat.h:100:
+		HINIC_DRIVER_NAME": " fmt "
", ##args)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1093: FILE: drivers/net/hinic/base/hinic_qe_def.h:287:
+#define WQ_SIZE(wq)		(u32)((u64)(wq)->q_depth * (wq)->wqebb_size)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1095: FILE: drivers/net/hinic/base/hinic_qe_def.h:289:
+#define	WQE_PAGE_NUM(wq, idx)	(((idx) >> ((wq)->wqebbs_per_page_shift)) & \
+				((wq)->num_q_pages - 1))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1098: FILE: drivers/net/hinic/base/hinic_qe_def.h:292:
+#define	WQE_PAGE_OFF(wq, idx)	((u64)((wq)->wqebb_size) * \
+				((idx) & ((wq)->num_wqebbs_per_page - 1)))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1103: FILE: drivers/net/hinic/base/hinic_qe_def.h:297:
+#define WQ_PAGE_ADDR(wq, idx)		\
+		(u8 *)(*(u64 *)((u64)((wq)->shadow_block_vaddr) + \
+		(WQE_PAGE_NUM(wq, idx) << WQ_PAGE_ADDR_SIZE_SHIFT)))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1119: FILE: drivers/net/hinic/base/hinic_qe_def.h:313:
+#define WQ_BASE_VADDR(wqs, wq)		\
+		(u64 *)(((u64)((wqs)->page_vaddr[(wq)->page_idx])) \
+				+ (wq)->block_idx * WQ_BLOCK_SIZE)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1123: FILE: drivers/net/hinic/base/hinic_qe_def.h:317:
+#define WQ_BASE_PADDR(wqs, wq)	(((wqs)->page_paddr[(wq)->page_idx]) \
+				+ (u64)(wq)->block_idx * WQ_BLOCK_SIZE)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1126: FILE: drivers/net/hinic/base/hinic_qe_def.h:320:
+#define WQ_BASE_ADDR(wqs, wq)		\
+		(u64 *)(((u64)((wqs)->shadow_page_vaddr[(wq)->page_idx])) \
+				+ (wq)->block_idx * WQ_BLOCK_SIZE)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wq' - possible side-effects?
#1144: FILE: drivers/net/hinic/base/hinic_qe_def.h:338:
+#define WQE_SHADOW_PAGE(wq, wqe)	\
+		(u16)(((unsigned long)(wqe) - (unsigned long)(wq)->shadow_wqe) \
+		/ (wq)->max_wqe_size)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wqe' - possible side-effects?
#1148: FILE: drivers/net/hinic/base/hinic_qe_def.h:342:
+#define WQE_IN_RANGE(wqe, start, end)	\
+		(((unsigned long)(wqe) >= (unsigned long)(start)) && \
+		((unsigned long)(wqe) < (unsigned long)(end)))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'rxq' - possible side-effects?
#1397: FILE: drivers/net/hinic/hinic_pmd_rx.h:12:
+#define HINIC_GET_RQ_LOCAL_CI(rxq)	\
+	(((rxq)->wq->cons_idx) & HINIC_GET_RQ_WQE_MASK(rxq))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'rxq' - possible side-effects?
#1400: FILE: drivers/net/hinic/hinic_pmd_rx.h:15:
+#define HINIC_GET_RQ_LOCAL_PI(rxq)	\
+	(((rxq)->wq->prod_idx) & HINIC_GET_RQ_WQE_MASK(rxq))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'rxq' - possible side-effects?
#1403: FILE: drivers/net/hinic/hinic_pmd_rx.h:18:
+#define HINIC_UPDATE_RQ_LOCAL_CI(rxq, wqebb_cnt)	\
+	do {						\
+		(rxq)->wq->cons_idx += (wqebb_cnt);	\
+		(rxq)->wq->delta += (wqebb_cnt);	\
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wqebb_cnt' - possible side-effects?
#1403: FILE: drivers/net/hinic/hinic_pmd_rx.h:18:
+#define HINIC_UPDATE_RQ_LOCAL_CI(rxq, wqebb_cnt)	\
+	do {						\
+		(rxq)->wq->cons_idx += (wqebb_cnt);	\
+		(rxq)->wq->delta += (wqebb_cnt);	\
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'rxq' - possible side-effects?
#1412: FILE: drivers/net/hinic/hinic_pmd_rx.h:27:
+#define HINIC_UPDATE_RQ_HW_PI(rxq, pi)	\
+	(*((rxq)->pi_virt_addr) =	\
+		cpu_to_be16((pi) & HINIC_GET_RQ_WQE_MASK(rxq)))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#1541: FILE: drivers/net/hinic/hinic_pmd_tx.h:15:
+#define HINIC_GET_SQ_HW_CI(txq)	\
+	((be16_to_cpu(*(txq)->cons_idx_addr)) & HINIC_GET_SQ_WQE_MASK(txq))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#1544: FILE: drivers/net/hinic/hinic_pmd_tx.h:18:
+#define HINIC_GET_SQ_LOCAL_CI(txq)	\
+	(((txq)->wq->cons_idx) & HINIC_GET_SQ_WQE_MASK(txq))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#1547: FILE: drivers/net/hinic/hinic_pmd_tx.h:21:
+#define HINIC_UPDATE_SQ_LOCAL_CI(txq, wqebb_cnt)	\
+	do {						\
+		(txq)->wq->cons_idx += wqebb_cnt;	\
+		(txq)->wq->delta += wqebb_cnt;		\
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'wqebb_cnt' - possible side-effects?
#1547: FILE: drivers/net/hinic/hinic_pmd_tx.h:21:
+#define HINIC_UPDATE_SQ_LOCAL_CI(txq, wqebb_cnt)	\
+	do {						\
+		(txq)->wq->cons_idx += wqebb_cnt;	\
+		(txq)->wq->delta += wqebb_cnt;		\
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#1556: FILE: drivers/net/hinic/hinic_pmd_tx.h:30:
+#define HINIC_IS_SQ_EMPTY(txq)	\
+		(((txq)->wq->delta) == ((txq)->q_depth))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#1559: FILE: drivers/net/hinic/hinic_pmd_tx.h:33:
+#define HINIC_GET_WQ_TAIL(txq) ((txq)->wq->queue_buf_vaddr + \
+				(txq)->wq->wq_buf_size)

total: 0 errors, 0 warnings, 25 checks, 1550 lines checked


More information about the test-report mailing list