Commit bd2b3343 authored by Yan Burman's avatar Yan Burman Committed by David S. Miller

[TG3]: replace kmalloc+memset with kzalloc

Replace kmalloc+memset with kzalloc
Signed-off-by: default avatarYan Burman <burman.yan@gmail.com>
Acked-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e25db641
...@@ -4426,7 +4426,7 @@ static void tg3_free_consistent(struct tg3 *tp) ...@@ -4426,7 +4426,7 @@ static void tg3_free_consistent(struct tg3 *tp)
*/ */
static int tg3_alloc_consistent(struct tg3 *tp) static int tg3_alloc_consistent(struct tg3 *tp)
{ {
tp->rx_std_buffers = kmalloc((sizeof(struct ring_info) * tp->rx_std_buffers = kzalloc((sizeof(struct ring_info) *
(TG3_RX_RING_SIZE + (TG3_RX_RING_SIZE +
TG3_RX_JUMBO_RING_SIZE)) + TG3_RX_JUMBO_RING_SIZE)) +
(sizeof(struct tx_ring_info) * (sizeof(struct tx_ring_info) *
...@@ -4435,13 +4435,6 @@ static int tg3_alloc_consistent(struct tg3 *tp) ...@@ -4435,13 +4435,6 @@ static int tg3_alloc_consistent(struct tg3 *tp)
if (!tp->rx_std_buffers) if (!tp->rx_std_buffers)
return -ENOMEM; return -ENOMEM;
memset(tp->rx_std_buffers, 0,
(sizeof(struct ring_info) *
(TG3_RX_RING_SIZE +
TG3_RX_JUMBO_RING_SIZE)) +
(sizeof(struct tx_ring_info) *
TG3_TX_RING_SIZE));
tp->rx_jumbo_buffers = &tp->rx_std_buffers[TG3_RX_RING_SIZE]; tp->rx_jumbo_buffers = &tp->rx_std_buffers[TG3_RX_RING_SIZE];
tp->tx_buffers = (struct tx_ring_info *) tp->tx_buffers = (struct tx_ring_info *)
&tp->rx_jumbo_buffers[TG3_RX_JUMBO_RING_SIZE]; &tp->rx_jumbo_buffers[TG3_RX_JUMBO_RING_SIZE];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment