aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2011-01-05 02:10:38 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-01-24 03:14:03 -0500
commit05b9321405efcca9ab217fb65c91915244ebf526 (patch)
tree00b2e8106dbe2de7b2367a7ae4a7c2aff6e015c6 /drivers/net/e1000e
parent90da06692532541a38f9857972e1fd6b1cdfb45a (diff)
e1000e: Use kmemdup rather than duplicating its implementation
The semantic patch that makes this output is available in scripts/coccinelle/api/memdup.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r--drivers/net/e1000e/ethtool.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 323fd12c306b..daa7fe4b9fdd 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -684,20 +684,13 @@ static int e1000_set_ringparam(struct net_device *netdev,
684 rx_old = adapter->rx_ring; 684 rx_old = adapter->rx_ring;
685 685
686 err = -ENOMEM; 686 err = -ENOMEM;
687 tx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL); 687 tx_ring = kmemdup(tx_old, sizeof(struct e1000_ring), GFP_KERNEL);
688 if (!tx_ring) 688 if (!tx_ring)
689 goto err_alloc_tx; 689 goto err_alloc_tx;
690 /*
691 * use a memcpy to save any previously configured
692 * items like napi structs from having to be
693 * reinitialized
694 */
695 memcpy(tx_ring, tx_old, sizeof(struct e1000_ring));
696 690
697 rx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL); 691 rx_ring = kmemdup(rx_old, sizeof(struct e1000_ring), GFP_KERNEL);
698 if (!rx_ring) 692 if (!rx_ring)
699 goto err_alloc_rx; 693 goto err_alloc_rx;
700 memcpy(rx_ring, rx_old, sizeof(struct e1000_ring));
701 694
702 adapter->tx_ring = tx_ring; 695 adapter->tx_ring = tx_ring;
703 adapter->rx_ring = rx_ring; 696 adapter->rx_ring = rx_ring;