[13/18] examples/ethtool: check status of getting link info

Message ID 1568103959-25572-14-git-send-email-arybchenko@solarflare.com
State New
Delegated to: Ferruh Yigit
Headers show
Series
  • ethdev: change link status get functions return value to int
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Sept. 10, 2019, 8:25 a.m.
From: Igor Romanov <igor.romanov@oktetlabs.ru>

The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ethtool/lib/rte_ethtool.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index 43cacc057..8393b0d60 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -124,9 +124,13 @@  int
 rte_ethtool_get_link(uint16_t port_id)
 {
 	struct rte_eth_link link;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-	rte_eth_link_get(port_id, &link);
+	ret = rte_eth_link_get(port_id, &link);
+	if (ret < 0)
+		return ret;
+
 	return link.link_status;
 }