From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <stable@dpdk.org>
Subject: [dpdk-stable] [PATCH 03/18] net/dpaa: fix FW version code
Date: Wed, 13 Dec 2017 17:35:44 +0530 [thread overview]
Message-ID: <1513166759-13466-4-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com>
fix the soc id path and missing fclose
Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 14 +++++---------
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 3023302..29678c5 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -212,19 +212,15 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused,
DPAA_PMD_ERR("Unable to open SoC device");
return -ENOTSUP; /* Not supported on this infra */
}
-
- ret = fscanf(svr_file, "svr:%x", &svr_ver);
- if (ret <= 0) {
+ if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0)
DPAA_PMD_ERR("Unable to read SoC device");
- return -ENOTSUP; /* Not supported on this infra */
- }
- ret = snprintf(fw_version, fw_size,
- "svr:%x-fman-v%x",
- svr_ver,
- fman_ip_rev);
+ fclose(svr_file);
+ ret = snprintf(fw_version, fw_size, "SVR:%x-fman-v%x",
+ svr_ver, fman_ip_rev);
ret += 1; /* add the size of '\0' */
+
if (fw_size < (uint32_t)ret)
return ret;
else
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 5457d61..ec5ae13 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -46,7 +46,7 @@
/* DPAA SoC identifier; If this is not available, it can be concluded
* that board is non-DPAA. Single slot is currently supported.
*/
-#define DPAA_SOC_ID_FILE "sys/devices/soc0/soc_id"
+#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id"
#define DPAA_MBUF_HW_ANNOTATION 64
#define DPAA_FD_PTA_SIZE 64
--
2.7.4
next prev parent reply other threads:[~2017-12-13 12:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com>
2017-12-13 12:05 ` [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues Hemant Agrawal
2018-01-09 10:46 ` Ferruh Yigit
2018-01-09 13:29 ` Hemant Agrawal
2017-12-13 12:05 ` [dpdk-stable] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal
2017-12-13 12:05 ` Hemant Agrawal [this message]
[not found] ` <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com>
2018-01-09 13:22 ` [dpdk-stable] [PATCH v2 01/18] " Hemant Agrawal
2018-01-09 13:22 ` [dpdk-stable] [PATCH v2 02/18] net/dpaa: fix FW version code Hemant Agrawal
[not found] ` <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com>
2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 01/19] net/dpaa: fix uninitialized and unused variables Hemant Agrawal
2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 02/19] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal
2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 03/19] net/dpaa: fix FW version code Hemant Agrawal
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=1513166759-13466-4-git-send-email-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.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).