[dpdk-stable] patch 'net/szedata2: fix format string for PCI address' has been queued to LTS release 16.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 1 12:44:49 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/03/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From cb3ca6a66c3f94384df6507f68afe9265639233e Mon Sep 17 00:00:00 2001
From: Matej Vido <vido at cesnet.cz>
Date: Wed, 4 Apr 2018 15:42:21 +0200
Subject: [PATCH] net/szedata2: fix format string for PCI address

[ upstream commit ddbbe324db8fa340e01a389844dc703e8cb30072 ]

For fscanf() function SCN macros should be used but PRI macros were
wrongly used.
Also use correct sizes of variables for read values.

Fixes: 83556fd2c0fc ("szedata2: change to physical device type")

Signed-off-by: Matej Vido <vido at cesnet.cz>
---
 drivers/net/szedata2/rte_eth_szedata2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 3070f1590..8b091cfed 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1366,9 +1366,9 @@ get_szedata2_index(struct rte_eth_dev *dev, uint32_t *index)
 	char pcislot_path[PATH_MAX];
 	struct rte_pci_addr pcislot_addr = dev->pci_dev->addr;
 	uint32_t domain;
-	uint32_t bus;
-	uint32_t devid;
-	uint32_t function;
+	uint8_t bus;
+	uint8_t devid;
+	uint8_t function;
 
 	dir = opendir("/sys/class/combo");
 	if (dir == NULL)
@@ -1393,7 +1393,7 @@ get_szedata2_index(struct rte_eth_dev *dev, uint32_t *index)
 		if (fd == NULL)
 			continue;
 
-		ret = fscanf(fd, "%4" PRIx16 ":%2" PRIx8 ":%2" PRIx8 ".%" PRIx8,
+		ret = fscanf(fd, "%8" SCNx32 ":%2" SCNx8 ":%2" SCNx8 ".%" SCNx8,
 				&domain, &bus, &devid, &function);
 		fclose(fd);
 		if (ret != 4)
-- 
2.14.2



More information about the stable mailing list