[dpdk-test-report] |WARNING| pw59510 [PATCH v2 03/22] net/hns3: add some definitions for data structure and macro

checkpatch at dpdk.org checkpatch at dpdk.org
Fri Sep 20 15:29:58 CEST 2019


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

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hw' - possible side-effects?
#540: FILE: drivers/net/hns3/hns3_ethdev.h:500:
+#define HNS3_DEV_HW_TO_ADAPTER(hw) \
+	container_of(hw, struct hns3_adapter, hw)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'origin' - possible side-effects?
#543: FILE: drivers/net/hns3/hns3_ethdev.h:503:
+#define hns3_set_field(origin, mask, shift, val) \
+	do { \
+		(origin) &= (~(mask)); \
+		(origin) |= ((val) << (shift)) & (mask); \
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'mask' - possible side-effects?
#543: FILE: drivers/net/hns3/hns3_ethdev.h:503:
+#define hns3_set_field(origin, mask, shift, val) \
+	do { \
+		(origin) &= (~(mask)); \
+		(origin) |= ((val) << (shift)) & (mask); \
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'shift' - possible side-effects?
#550: FILE: drivers/net/hns3/hns3_ethdev.h:510:
+#define hns3_set_bit(origin, shift, val) \
+	hns3_set_field((origin), (0x1UL << (shift)), (shift), (val))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'shift' - possible side-effects?
#552: FILE: drivers/net/hns3/hns3_ethdev.h:512:
+#define hns3_get_bit(origin, shift) \
+	hns3_get_field((origin), (0x1UL << (shift)), (shift))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'y' - possible side-effects?
#572: FILE: drivers/net/hns3/hns3_ethdev.h:532:
+#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects?
#573: FILE: drivers/net/hns3/hns3_ethdev.h:533:
+#define rounddown(x, y) ((x) - ((x) % (y)))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'd' - possible side-effects?
#575: FILE: drivers/net/hns3/hns3_ethdev.h:535:
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects?
#598: FILE: drivers/net/hns3/hns3_ethdev.h:558:
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'act' - possible side-effects?
#600: FILE: drivers/net/hns3/hns3_ethdev.h:560:
+#define NEXT_ITEM_OF_ACTION(act, actions, index)                        \
+	do {								\
+		act = (actions) + (index);				\
+		while (act->type == RTE_FLOW_ACTION_TYPE_VOID) {	\
+			(index)++;					\
+			act = actions + index;				\
+		}							\
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'actions' - possible side-effects?
#600: FILE: drivers/net/hns3/hns3_ethdev.h:560:
+#define NEXT_ITEM_OF_ACTION(act, actions, index)                        \
+	do {								\
+		act = (actions) + (index);				\
+		while (act->type == RTE_FLOW_ACTION_TYPE_VOID) {	\
+			(index)++;					\
+			act = actions + index;				\
+		}							\
+	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'index' - possible side-effects?
#600: FILE: drivers/net/hns3/hns3_ethdev.h:560:
+#define NEXT_ITEM_OF_ACTION(act, actions, index)                        \
+	do {								\
+		act = (actions) + (index);				\
+		while (act->type == RTE_FLOW_ACTION_TYPE_VOID) {	\
+			(index)++;					\
+			act = actions + index;				\
+		}							\
+	} while (0)

total: 0 errors, 0 warnings, 12 checks, 611 lines checked


More information about the test-report mailing list