[dpdk-test-report] |WARNING| pw49055 [v6, 14/31] net/ice/base: add OS specific implementation

checkpatch at dpdk.org checkpatch at dpdk.org
Tue Dec 18 09:43:11 CET 2018


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

_coding style issues_


WARNING:ARRAY_SIZE: Prefer ARRAY_SIZE(arr)
#154: FILE: drivers/net/ice/base/ice_osdep.h:93:
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'arr' - possible side-effects?
#154: FILE: drivers/net/ice/base/ice_osdep.h:93:
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 't' may be better as '(t)' to avoid precedence issues
#155: FILE: drivers/net/ice/base/ice_osdep.h:94:
+#define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->f))

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'f' may be better as '(f)' to avoid precedence issues
#155: FILE: drivers/net/ice/base/ice_osdep.h:94:
+#define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->f))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'h' - possible side-effects?
#161: FILE: drivers/net/ice/base/ice_osdep.h:100:
+#define ice_debug(h, m, s, ...)					\
+do {								\
+	if (((m) & (h)->debug_mask))				\
+		PMD_DRV_LOG_RAW(DEBUG, "ice %02x.%x " s,	\
+			(h)->bus.device, (h)->bus.func,		\
+					##__VA_ARGS__);		\
+} while (0)

CHECK:CAMELCASE: Avoid CamelCase: <PRIx64>
#179: FILE: drivers/net/ice/base/ice_osdep.h:118:
+				  "0x%04X  0x%016"PRIx64"
",		\

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#179: FILE: drivers/net/ice/base/ice_osdep.h:118:
+				  "0x%04X  0x%016"PRIx64"
",		\

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'd' - possible side-effects?
#212: FILE: drivers/net/ice/base/ice_osdep.h:151:
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'bit' - possible side-effects?
#284: FILE: drivers/net/ice/base/ice_osdep.h:223:
+#define for_each_set_bit(bit, addr, size)				\
+	for ((bit) = ice_find_first_bit((addr), (size));		\
+	(bit) < (size);							\
+	(bit) = ice_find_next_bit((addr), (size), (bit) + 1))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'addr' - possible side-effects?
#284: FILE: drivers/net/ice/base/ice_osdep.h:223:
+#define for_each_set_bit(bit, addr, size)				\
+	for ((bit) = ice_find_first_bit((addr), (size));		\
+	(bit) < (size);							\
+	(bit) = ice_find_next_bit((addr), (size), (bit) + 1))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'size' - possible side-effects?
#284: FILE: drivers/net/ice/base/ice_osdep.h:223:
+#define for_each_set_bit(bit, addr, size)				\
+	for ((bit) = ice_find_first_bit((addr), (size));		\
+	(bit) < (size);							\
+	(bit) = ice_find_next_bit((addr), (size), (bit) + 1))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'c' - possible side-effects?
#320: FILE: drivers/net/ice/base/ice_osdep.h:259:
+#define ice_memdup(a, b, c, d) rte_memcpy(ice_malloc(a, c), b, c)

CHECK:CAMELCASE: Avoid CamelCase: <PRIu64>
#456: FILE: drivers/net/ice/base/ice_osdep.h:395:
+	snprintf(z_name, sizeof(z_name), "ice_dma_%"PRIu64, rte_rand());

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#456: FILE: drivers/net/ice/base/ice_osdep.h:395:
+	snprintf(z_name, sizeof(z_name), "ice_dma_%"PRIu64, rte_rand());

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#467: FILE: drivers/net/ice/base/ice_osdep.h:406:
+		    "%"PRIu64, mz->name, mem->pa);

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#477: FILE: drivers/net/ice/base/ice_osdep.h:416:
+		    "%"PRIu64, ((const struct rte_memzone *)mem->zone)->name,

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'd' - possible side-effects?
#499: FILE: drivers/net/ice/base/ice_osdep.h:438:
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'pos' - possible side-effects?
#524: FILE: drivers/net/ice/base/ice_osdep.h:463:
+#define LIST_FOR_EACH_ENTRY(pos, head, type, member)			       \
+	for ((pos) = (head)->lh_first ?					       \
+		     container_of((head)->lh_first, struct type, member) :     \
+		     0;							       \
+	     (pos);							       \
+	     (pos) = (pos)->member.next.le_next ?			       \
+		     container_of((pos)->member.next.le_next, struct type,     \
+				  member) :				       \
+		     0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'head' - possible side-effects?
#524: FILE: drivers/net/ice/base/ice_osdep.h:463:
+#define LIST_FOR_EACH_ENTRY(pos, head, type, member)			       \
+	for ((pos) = (head)->lh_first ?					       \
+		     container_of((head)->lh_first, struct type, member) :     \
+		     0;							       \
+	     (pos);							       \
+	     (pos) = (pos)->member.next.le_next ?			       \
+		     container_of((pos)->member.next.le_next, struct type,     \
+				  member) :				       \
+		     0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'member' - possible side-effects?
#524: FILE: drivers/net/ice/base/ice_osdep.h:463:
+#define LIST_FOR_EACH_ENTRY(pos, head, type, member)			       \
+	for ((pos) = (head)->lh_first ?					       \
+		     container_of((head)->lh_first, struct type, member) :     \
+		     0;							       \
+	     (pos);							       \
+	     (pos) = (pos)->member.next.le_next ?			       \
+		     container_of((pos)->member.next.le_next, struct type,     \
+				  member) :				       \
+		     0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'list_head' - possible side-effects?
#534: FILE: drivers/net/ice/base/ice_osdep.h:473:
+#define LIST_REPLACE_INIT(list_head, head) do {				\
+	(head)->lh_first = (list_head)->lh_first;			\
+	INIT_LIST_HEAD(list_head);					\
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'b' - possible side-effects?
#555: FILE: drivers/net/ice/base/ice_osdep.h:494:
+#define DIVIDE_AND_ROUND_UP(a, b) (((a) + (b) - 1) / (b))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'addr' - possible side-effects?
#579: FILE: drivers/net/ice/base/ice_osdep.h:518:
+#define IS_ZERO_ETHER_ADDR(addr) \
+	(((bool)((((u16 *)(addr))[0] == ((u16)0x0)))) && \
+	 ((bool)((((u16 *)(addr))[1] == ((u16)0x0)))) && \
+	 ((bool)((((u16 *)(addr))[2] == ((u16)0x0)))))

total: 0 errors, 1 warnings, 22 checks, 546 lines checked


More information about the test-report mailing list