DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matej Vido <vido@cesnet.cz>
To: dev@dpdk.org
Cc: remes@netcope.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 4/4] net/szedata2: fix format string for pci address
Date: Wed,  4 Apr 2018 15:42:21 +0200	[thread overview]
Message-ID: <1522849341-49049-5-git-send-email-vido@cesnet.cz> (raw)
In-Reply-To: <1522849341-49049-1-git-send-email-vido@cesnet.cz>

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")
Cc: stable@dpdk.org

Signed-off-by: Matej Vido <vido@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 8278780..04dc8bf 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1488,9 +1488,9 @@ struct szedata2_tx_queue {
 	FILE *fd;
 	char pcislot_path[PATH_MAX];
 	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)
@@ -1515,7 +1515,7 @@ struct szedata2_tx_queue {
 		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)
-- 
1.8.3.1

  parent reply	other threads:[~2018-04-04 13:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04 13:42 [dpdk-dev] [PATCH 0/4] net/szedata2: fixes or improvements Matej Vido
2018-04-04 13:42 ` [dpdk-dev] [PATCH 1/4] net/szedata2: fix total stats Matej Vido
2018-04-04 13:42 ` [dpdk-dev] [PATCH 2/4] net/szedata2: use dynamically allocated queues Matej Vido
2018-04-06 13:20   ` Ferruh Yigit
2018-04-06 13:51     ` Ferruh Yigit
2018-04-04 13:42 ` [dpdk-dev] [PATCH 3/4] net/szedata2: add stat of mbuf allocation failures Matej Vido
2018-04-04 13:42 ` Matej Vido [this message]
2018-04-06 13:53 ` [dpdk-dev] [PATCH 0/4] net/szedata2: fixes or improvements Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522849341-49049-5-git-send-email-vido@cesnet.cz \
    --to=vido@cesnet.cz \
    --cc=dev@dpdk.org \
    --cc=remes@netcope.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).