From cddaf87a1ecb8e44e934913a55703f9a568584d4 Mon Sep 17 00:00:00 2001 From: Zijie Pan Date: Tue, 4 Dec 2012 17:17:43 +0800 Subject: [PATCH] lib: fix unused values Fix warnings of type "Value stored to 'xxx' is never read". Signed-off-by: Zijie Pan Acked-by: Ivan Boule Acked-by: Adrien Mazarguil --- lib/librte_cmdline/cmdline_parse_ipaddr.c | 1 - lib/librte_eal/linuxapp/eal/eal_thread.c | 2 -- lib/librte_lpm/rte_lpm.c | 2 +- lib/librte_pmd_e1000/igb_rxtx.c | 2 -- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 4 ++++ 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c index 7659a1d576..4ab3ac3aa5 100644 --- a/lib/librte_cmdline/cmdline_parse_ipaddr.c +++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c @@ -266,7 +266,6 @@ inet_pton6(const char *src, unsigned char *dst) inet_pton4(curtok, tp) > 0) { tp += INADDRSZ; saw_xdigit = 0; - count_xdigit = 0; dbloct_count += 2; break; /* '\0' was seen by inet_pton4(). */ } diff --git a/lib/librte_eal/linuxapp/eal/eal_thread.c b/lib/librte_eal/linuxapp/eal/eal_thread.c index 601614296b..69bc10ee90 100644 --- a/lib/librte_eal/linuxapp/eal/eal_thread.c +++ b/lib/librte_eal/linuxapp/eal/eal_thread.c @@ -85,7 +85,6 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id) rte_panic("cannot write on configuration pipe\n"); /* wait ack */ - n = 0; do { n = read(s2m, &c, 1); } while (n < 0 && errno == EINTR); @@ -202,7 +201,6 @@ eal_thread_loop(__attribute__((unused)) void *arg) void *fct_arg; /* wait command */ - n = 0; do { n = read(m2s, &c, 1); } while (n < 0 && errno == EINTR); diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index 10705fc406..f816fdd618 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -253,7 +253,7 @@ rule_add(struct rte_lpm *lpm, uint32_t ip_masked, uint8_t depth, last_rule = rule_gindex + lpm->used_rules_at_depth[depth - 1]; /* Scan through rule group to see if rule already exists. */ - for (rule_index = rule_gindex; rule_index < last_rule; rule_index++) { + for (; rule_index < last_rule; rule_index++) { /* If rule already exists update its next_hop and return. */ if (lpm->rules_tbl[rule_index].ip == ip_masked) { diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index c942e1e48b..f70ea5a712 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -1231,8 +1231,6 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev, txq->tx_ring_phys_addr = (uint64_t) tz->phys_addr; txq->tx_ring = (union e1000_adv_tx_desc *) tz->addr; - size = sizeof(union e1000_adv_tx_desc) * nb_desc; - /* Allocate software ring */ txq->sw_ring = rte_zmalloc("txq->sw_ring", sizeof(struct igb_tx_entry) * nb_desc, diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 31434a77ab..8350ee2039 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -708,6 +708,10 @@ eth_ixgbevf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, hw->mac.num_rar_entries = hw->mac.max_rx_queues; diag = hw->mac.ops.reset_hw(hw); + if (diag != IXGBE_SUCCESS) { + PMD_INIT_LOG(ERR, "VF Initialization Failure: %d", diag); + return (diag); + } /* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs = rte_zmalloc("ixgbevf", ETHER_ADDR_LEN * -- 2.20.1