Skip to contentSkip to conversation

ethdev: remove useless pointer initialization

PATCH Applied Emmanuel Roullit 2 participants 2 messages Jan 24, 2017 – Jan 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: remove useless pointer initialization

Found with clang static analysis:
lib/librte_ether/rte_ethdev.c:2467:22:
warning: Value stored to 'dev' during its initialization is never read

struct rte_eth_dev *dev = &rte_eth_devices[port_id];
                    ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes 61207d014fc9 ("ethdev: fix data reset when allocating port")
---
 lib/librte_ether/rte_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_ether/rte_ethdev.c +2 -2
index 61f44e218..d7f78c23a 100644
@@ -2364,7 +2364,7 @@ rte_eth_mirror_rule_set(uint8_t port_id,
 			struct rte_eth_mirror_conf *mirror_conf,
 			uint8_t rule_id, uint8_t on)
 {
-	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+	struct rte_eth_dev *dev;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	if (mirror_conf->rule_type == 0) {
@@ -2400,7 +2400,7 @@ rte_eth_mirror_rule_set(uint8_t port_id,
 int
 rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id)
 {
-	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+	struct rte_eth_dev *dev;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
Signature · 1 line
2.11.0
#1 lore raw

2017-01-24 21:28, Emmanuel Roullit:

Quoted 7 lines

Found with clang static analysis:
lib/librte_ether/rte_ethdev.c:2467:22:
warning: Value stored to 'dev' during its initialization is never read

struct rte_eth_dev *dev = &rte_eth_devices[port_id];
                    ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes 61207d014fc9 ("ethdev: fix data reset when allocating port")

Wrong commit reference.

Fixes 88ac4396ad29 ("ethdev: add VMDq support")
Quoted 1 line

Applied, thanks