[PATCH 22] drivers/net/e1000new/ethtool.c: kmalloc + memset conversion to kzalloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Mariusz Kozlowski <[email protected]>

 drivers/net/e1000new/ethtool.c | 58607 -> 58527 (-80 bytes)
 drivers/net/e1000new/ethtool.o | 197636 -> 197312 (-324 bytes)

 drivers/net/e1000new/ethtool.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- linux-2.6.23-rc1-mm1-a/drivers/net/e1000new/ethtool.c	2007-07-26 13:07:43.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/drivers/net/e1000new/ethtool.c	2007-07-30 00:31:08.000000000 +0200
@@ -1031,12 +1031,11 @@ static int e1000_setup_desc_rings(struct
 		tx_ring->count = E1000_DEFAULT_TXD;

 	size = tx_ring->count * sizeof(struct e1000_buffer);
-	tx_ring->buffer_info = kmalloc(size, GFP_KERNEL);
+	tx_ring->buffer_info = kzalloc(size, GFP_KERNEL);
 	if (!tx_ring->buffer_info) {
 		ret_val = 1;
 		goto err_nomem;
 	}
-	memset(tx_ring->buffer_info, 0, size);

 	tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
 	tx_ring->size = ALIGN(tx_ring->size, 4096);
@@ -1092,12 +1091,11 @@ static int e1000_setup_desc_rings(struct
 		rx_ring->count = E1000_DEFAULT_RXD;

 	size = rx_ring->count * sizeof(struct e1000_buffer);
-	rx_ring->buffer_info = kmalloc(size, GFP_KERNEL);
+	rx_ring->buffer_info = kzalloc(size, GFP_KERNEL);
 	if (!rx_ring->buffer_info) {
 		ret_val = 4;
 		goto err_nomem;
 	}
-	memset(rx_ring->buffer_info, 0, size);

 	rx_ring->size = rx_ring->count * sizeof(struct e1000_rx_desc);
 	rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux