From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from office2.cesnet.cz (office2.cesnet.cz [195.113.144.244]) by dpdk.org (Postfix) with ESMTP id 82FEE1C625; Wed, 4 Apr 2018 15:42:45 +0200 (CEST) Received: from emilion.liberouter.org (emilion.liberouter.org [195.113.172.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 53C8340004E; Wed, 4 Apr 2018 15:42:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2; t=1522849365; bh=PU3bUf1u0TujHiz2t8fuMxvoOu5lcQtI7cYhEHuIlPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jYKnUrvL5dlJB0I+wk8ZF1r9LiUw/1o9KgmjEgFBR0FmBpRHZKuKSJ2Z7fkcsy60h MEBKtLs5mw/RK5nMEvTQp3sXsST+MgTitQrazHegtrm0Ja5iru0gODt70r0yMaykHX ahtrPZ3BHPEMrRhuISpz/+h/la++6lbxmBU+s94E= From: Matej Vido To: dev@dpdk.org Cc: remes@netcope.com, stable@dpdk.org Date: Wed, 4 Apr 2018 15:42:21 +0200 Message-Id: <1522849341-49049-5-git-send-email-vido@cesnet.cz> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1522849341-49049-1-git-send-email-vido@cesnet.cz> References: <1522849341-49049-1-git-send-email-vido@cesnet.cz> Subject: [dpdk-dev] [PATCH 4/4] net/szedata2: fix format string for pci address X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 13:42:45 -0000 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 --- 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