From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/3] bonding: remove useless memset
Date: Wed, 3 Jun 2015 14:13:10 -0700 [thread overview]
Message-ID: <1433365992-9173-2-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1433365992-9173-1-git-send-email-stephen@networkplumber.org>
Remove 2 unneeded memset's. The info area is already cleared rte_eth_dev_info_get
and the statistics buffer is cleared by rte_eth_stats_get
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bonding/rte_eth_bond_api.c | 1 -
drivers/net/bonding/rte_eth_bond_pmd.c | 4 ----
2 files changed, 5 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index e91a623..d4caa83 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -363,7 +363,6 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)
/* Add slave details to bonded device */
slave_add(internals, slave_eth_dev);
- memset(&dev_info, 0, sizeof(dev_info));
rte_eth_dev_info_get(slave_port_id, &dev_info);
if (internals->slave_count < 1) {
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index c937e6b..8bad2e1 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1730,12 +1730,8 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
{
struct bond_dev_private *internals = dev->data->dev_private;
struct rte_eth_stats slave_stats;
-
int i;
- /* clear bonded stats before populating from slaves */
- memset(stats, 0, sizeof(*stats));
-
for (i = 0; i < internals->slave_count; i++) {
rte_eth_stats_get(internals->slaves[i].port_id, &slave_stats);
--
2.1.4
next prev parent reply other threads:[~2015-06-03 21:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 21:13 [dpdk-dev] [PATCH 0/3] get rid of unnecessary memset's Stephen Hemminger
2015-06-03 21:13 ` Stephen Hemminger [this message]
2015-06-03 21:13 ` [dpdk-dev] [PATCH 2/3] ethdev: remove useless memset Stephen Hemminger
2015-06-03 21:13 ` [dpdk-dev] [PATCH 3/3] null: remove unnecessary memset Stephen Hemminger
2015-06-04 8:47 ` [dpdk-dev] [PATCH 0/3] get rid of unnecessary memset's Thomas Monjalon
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=1433365992-9173-2-git-send-email-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@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).