[dpdk-test-report] |WARNING| pw25503 [PATCH v3 6/9] bus/pci: introduce pci bus

checkpatch at dpdk.org checkpatch at dpdk.org
Wed Jun 21 01:39:39 CEST 2017


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

_coding style issues_


WARNING:AVOID_EXTERNS: externs should be avoided in .c files
#339: FILE: drivers/bus/pci/bsd/rte_pci.c:90:
+extern struct rte_pci_bus rte_pci_bus;

WARNING:LONG_LINE: line over 90 characters
#407: FILE: drivers/bus/pci/bsd/rte_pci.c:158:
+				"skipping
", loc->domain, loc->bus, loc->devid, loc->function);

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#498: FILE: drivers/bus/pci/bsd/rte_pci.c:249:
+	unsigned i, max;

WARNING:BRACES: braces {} are not necessary for single statement blocks
#501: FILE: drivers/bus/pci/bsd/rte_pci.c:252:
+	if (dev == NULL) {
+		return -1;
+	}

WARNING:LONG_LINE: line over 90 characters
#563: FILE: drivers/bus/pci/bsd/rte_pci.c:314:
+			dev->mem_resource[i].addr = (void *)(bar.pbi_base & ~((uint64_t)0xf));

ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
#573: FILE: drivers/bus/pci/bsd/rte_pci.c:324:
+	}
+	else {

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#611: FILE: drivers/bus/pci/bsd/rte_pci.c:362:
+	unsigned dev_count = 0;

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#632: FILE: drivers/bus/pci/bsd/rte_pci.c:383:
+		unsigned i;

ERROR:SPACING: space required before the open parenthesis '('
#644: FILE: drivers/bus/pci/bsd/rte_pci.c:395:
+	} while(conf_io.status == PCI_GETCONF_MORE_DEVS);

WARNING:LONG_LINE_COMMENT: line over 90 characters
#1060: FILE: drivers/bus/pci/include/rte_pci.h:133:
+	uint32_t class_id;            /**< Class ID (class, subclass, pi) or RTE_CLASS_ANY_ID. */

ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#1108: FILE: drivers/bus/pci/include/rte_pci.h:181:
+#define RTE_PCI_DEVICE(vend, dev) \
+	RTE_CLASS_ANY_ID,         \
+	(vend),                   \
+	(dev),                    \
+	PCI_ANY_ID,               \
+	PCI_ANY_ID

WARNING:LONG_LINE_COMMENT: line over 90 characters
#1144: FILE: drivers/bus/pci/include/rte_pci.h:217:
+	uint32_t drv_flags;                     /**< Flags contolling handling of device. */

WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#1194: FILE: drivers/bus/pci/include/rte_pci.h:267:
+#define GET_PCIADDR_FIELD(in, fd, lim, dlm)                   \
+do {                                                               \
+	unsigned long val;                                      \
+	char *end;                                              \
+	errno = 0;                                              \
+	val = strtoul((in), &end, 16);                          \
+	if (errno != 0 || end[0] != (dlm) || val > (lim))       \
+		return -EINVAL;                                 \
+	(fd) = (typeof (fd))val;                                \
+	(in) = end + 1;                                         \
+} while(0)

WARNING:SPACING: space prohibited between function name and open parenthesis '('
#1202: FILE: drivers/bus/pci/include/rte_pci.h:275:
+	(fd) = (typeof (fd))val;                                \

ERROR:SPACING: space required before the open parenthesis '('
#1204: FILE: drivers/bus/pci/include/rte_pci.h:277:
+} while(0)

WARNING:AVOID_EXTERNS: externs should be avoided in .c files
#1692: FILE: drivers/bus/pci/linux/rte_pci.c:59:
+extern struct rte_pci_bus rte_pci_bus;

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#1783: FILE: drivers/bus/pci/linux/rte_pci.c:150:
+	unsigned i = 0;

ERROR:SPACING: spaces required around that '<' (ctx:VxV)
#1845: FILE: drivers/bus/pci/linux/rte_pci.c:212:
+	for (i = 0; i<PCI_MAX_RESOURCE; i++) {
 	             ^

ERROR:SPACING: space required after that ',' (ctx:VxV)
#2060: FILE: drivers/bus/pci/linux/rte_pci.c:427:
+	splitaddr.function = strchr(splitaddr.devid,'.');
 	                                           ^

WARNING:NAKED_SSCANF: unchecked sscanf return value
#2215: FILE: drivers/bus/pci/linux/rte_pci.c:582:
+			sscanf(ptr, "%04hx-%04hx", &start, &end);

ERROR:CODE_INDENT: code indent should use tabs where possible
#2447: FILE: drivers/bus/pci/linux/rte_pci_init.h:84:
+^I^I        struct rte_pci_ioport *p);$

ERROR:GLOBAL_INITIALISERS: do not initialise globals to NULL
#2523: FILE: drivers/bus/pci/linux/rte_pci_uio.c:57:
+void *pci_map_addr = NULL;

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#2571: FILE: drivers/bus/pci/linux/rte_pci_uio.c:105:
+pci_mknod_uio_dev(const char *sysfs_uio_path, unsigned uio_num)

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#2576: FILE: drivers/bus/pci/linux/rte_pci_uio.c:110:
+	unsigned major, minor;

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#2580: FILE: drivers/bus/pci/linux/rte_pci_uio.c:114:
+	 * of the uio device and read its content */

WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUSR | S_IWUSR' are not preferred. Consider using octal permissions '0600'.
#2602: FILE: drivers/bus/pci/linux/rte_pci_uio.c:136:
+	ret = mknod(filename, S_IFCHR | S_IRUSR | S_IWUSR, dev);

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#2629: FILE: drivers/bus/pci/linux/rte_pci_uio.c:163:
+	 * or uio:uioX */

WARNING:LONG_LINE: line over 90 characters
#2723: FILE: drivers/bus/pci/linux/rte_pci_uio.c:257:
+				"skipping
", loc->domain, loc->bus, loc->devid, loc->function);

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#2863: FILE: drivers/bus/pci/linux/rte_pci_uio.c:397:
+	 * uin16_t */

WARNING:LONG_LINE: line over 90 characters
#3169: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:130:
+					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +

WARNING:LONG_LINE: line over 90 characters
#3186: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:147:
+					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +

WARNING:LONG_LINE: line over 90 characters
#3195: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:156:
+					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#3296: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:257:
+		 * specified interrupt type, otherwise continue */

WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return
#3302: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:263:
+				return -1;
+			} else

WARNING:LONG_LINE: line over 90 characters
#3355: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:316:
+	struct mapped_pci_res_list *vfio_res_list = RTE_TAILQ_CAST(rte_vfio_tailq.head, mapped_pci_res_list);

ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#3369: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:330:
+	if ((ret = vfio_setup_device(pci_get_sysfs_path(), pci_addr,

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#3374: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:335:
+	 * easily mmap it when using VFIO) */

WARNING:LONG_LINE: line over 90 characters
#3431: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:392:
+					"error %i (%s)
", pci_addr, errno, strerror(errno));

WARNING:LONG_LINE: line over 90 characters
#3557: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:518:
+			RTE_LOG(ERR, EAL, "  %s error setting up interrupts!
", pci_addr);

WARNING:LONG_LINE: line over 90 characters
#3565: FILE: drivers/bus/pci/linux/rte_pci_vfio.c:526:
+			RTE_LOG(ERR, EAL, "  %s cannot set up bus mastering!
", pci_addr);

WARNING:AVOID_EXTERNS: externs should be avoided in .c files
#4381: FILE: drivers/bus/pci/rte_pci_common.c:59:
+extern struct rte_pci_bus rte_pci_bus;

total: 9 errors, 32 warnings, 5253 lines checked


More information about the test-report mailing list