[dpdk-test-report] |WARNING| pw48819 [v4, 15/32] net/ice/base: add OS specific implementation

checkpatch at dpdk.org checkpatch at dpdk.org
Fri Dec 14 09:32:55 CET 2018


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

_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))

ERROR:CODE_INDENT: code indent should use tabs where possible
#227: FILE: drivers/net/ice/base/ice_osdep.h:166:
+        return !!(bitmap[BIT_CHUNK(nr)] & BIT_IN_CHUNK(nr));$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#227: FILE: drivers/net/ice/base/ice_osdep.h:166:
+        return !!(bitmap[BIT_CHUNK(nr)] & BIT_IN_CHUNK(nr));$

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_PRECEDENCE: Macro argument 'c' may be better as '(c)' to avoid precedence issues
#315: FILE: drivers/net/ice/base/ice_osdep.h:254:
+#define ice_calloc(h, c, s) rte_zmalloc(NULL, c * s, 0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 's' may be better as '(s)' to avoid precedence issues
#315: FILE: drivers/net/ice/base/ice_osdep.h:254:
+#define ice_calloc(h, c, s) rte_zmalloc(NULL, c * s, 0)

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)

ERROR:CODE_INDENT: code indent should use tabs where possible
#384: FILE: drivers/net/ice/base/ice_osdep.h:323:
+        ice_bitmap_t mask;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#384: FILE: drivers/net/ice/base/ice_osdep.h:323:
+        ice_bitmap_t mask;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#385: FILE: drivers/net/ice/base/ice_osdep.h:324:
+        u16 i;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#385: FILE: drivers/net/ice/base/ice_osdep.h:324:
+        u16 i;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#387: FILE: drivers/net/ice/base/ice_osdep.h:326:
+        /* Handle all but last chunk*/$

ERROR:CODE_INDENT: code indent should use tabs where possible
#388: FILE: drivers/net/ice/base/ice_osdep.h:327:
+        for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#388: FILE: drivers/net/ice/base/ice_osdep.h:327:
+        for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)$

ERROR:CODE_INDENT: code indent should use tabs where possible
#389: FILE: drivers/net/ice/base/ice_osdep.h:328:
+                dst[i] = src[i];$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#389: FILE: drivers/net/ice/base/ice_osdep.h:328:
+                dst[i] = src[i];$

ERROR:CODE_INDENT: code indent should use tabs where possible
#391: FILE: drivers/net/ice/base/ice_osdep.h:330:
+        /* We want to only copy bits within the size.*/$

ERROR:CODE_INDENT: code indent should use tabs where possible
#392: FILE: drivers/net/ice/base/ice_osdep.h:331:
+        mask = BITS_CHUNK_MASK(size);$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#392: FILE: drivers/net/ice/base/ice_osdep.h:331:
+        mask = BITS_CHUNK_MASK(size);$

ERROR:CODE_INDENT: code indent should use tabs where possible
#393: FILE: drivers/net/ice/base/ice_osdep.h:332:
+        dst[i] &= ~mask;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#393: FILE: drivers/net/ice/base/ice_osdep.h:332:
+        dst[i] &= ~mask;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#394: FILE: drivers/net/ice/base/ice_osdep.h:333:
+        dst[i] |= src[i] & mask;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#394: FILE: drivers/net/ice/base/ice_osdep.h:333:
+        dst[i] |= src[i] & mask;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#400: FILE: drivers/net/ice/base/ice_osdep.h:339:
+        ice_bitmap_t mask;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#400: FILE: drivers/net/ice/base/ice_osdep.h:339:
+        ice_bitmap_t mask;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#401: FILE: drivers/net/ice/base/ice_osdep.h:340:
+        u16 i;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#401: FILE: drivers/net/ice/base/ice_osdep.h:340:
+        u16 i;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#403: FILE: drivers/net/ice/base/ice_osdep.h:342:
+        /* Handle all but last chunk*/$

ERROR:CODE_INDENT: code indent should use tabs where possible
#404: FILE: drivers/net/ice/base/ice_osdep.h:343:
+        for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#404: FILE: drivers/net/ice/base/ice_osdep.h:343:
+        for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)$

ERROR:CODE_INDENT: code indent should use tabs where possible
#405: FILE: drivers/net/ice/base/ice_osdep.h:344:
+                if (bmp1[i] != bmp2[i])$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#405: FILE: drivers/net/ice/base/ice_osdep.h:344:
+                if (bmp1[i] != bmp2[i])$

ERROR:CODE_INDENT: code indent should use tabs where possible
#406: FILE: drivers/net/ice/base/ice_osdep.h:345:
+                        return false;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#406: FILE: drivers/net/ice/base/ice_osdep.h:345:
+                        return false;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#408: FILE: drivers/net/ice/base/ice_osdep.h:347:
+        /* We want to only compare bits within the size.*/$

ERROR:CODE_INDENT: code indent should use tabs where possible
#409: FILE: drivers/net/ice/base/ice_osdep.h:348:
+        mask = BITS_CHUNK_MASK(size);$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#409: FILE: drivers/net/ice/base/ice_osdep.h:348:
+        mask = BITS_CHUNK_MASK(size);$

ERROR:CODE_INDENT: code indent should use tabs where possible
#410: FILE: drivers/net/ice/base/ice_osdep.h:349:
+        if ((bmp1[i] & mask) != (bmp2[i] & mask))$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#410: FILE: drivers/net/ice/base/ice_osdep.h:349:
+        if ((bmp1[i] & mask) != (bmp2[i] & mask))$

ERROR:CODE_INDENT: code indent should use tabs where possible
#411: FILE: drivers/net/ice/base/ice_osdep.h:350:
+                return false;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#411: FILE: drivers/net/ice/base/ice_osdep.h:350:
+                return false;$

ERROR:CODE_INDENT: code indent should use tabs where possible
#413: FILE: drivers/net/ice/base/ice_osdep.h:352:
+        return true;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#413: FILE: drivers/net/ice/base/ice_osdep.h:352:
+        return true;$

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: 21 errors, 18 warnings, 24 checks, 546 lines checked


More information about the test-report mailing list