[PATCH 2.6.19] tg3: replace kmalloc+memset with kzalloc



Replace kmalloc+memset with kzalloc

Signed-off-by: Yan Burman <burman.yan@xxxxxxxxx>

diff -rubp linux-2.6.19-rc5_orig/drivers/net/tg3.c linux-2.6.19-rc5_kzalloc/drivers/net/tg3.c
--- linux-2.6.19-rc5_orig/drivers/net/tg3.c 2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/net/tg3.c 2006-11-11 22:44:18.000000000 +0200
@@ -4416,7 +4416,7 @@ static void tg3_free_consistent(struct t
*/
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_JUMBO_RING_SIZE)) +
(sizeof(struct tx_ring_info) *
@@ -4425,13 +4425,6 @@ static int tg3_alloc_consistent(struct t
if (!tp->rx_std_buffers)
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->tx_buffers = (struct tx_ring_info *)
&tp->rx_jumbo_buffers[TG3_RX_JUMBO_RING_SIZE];




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [PATCH] hgafb: fix module removal
    ... today this might cause all sort of bugs. ... This patch was build-tested only. ... static int __init hgafb_init ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
    (Linux-Kernel)
  • Re: [patch 3/3] ext2: use perform_write aop
    ... Generic "read page" function for block devices that have the normal ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: hello world module
    ... * hello_init - the init function, called when the module is loaded. ... static int hello_init ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [RFC PATCH] move tg3 to pci_request_irq
    ... This proof-of-concept patch converts the tg3 driver to use the ... unsigned long flags; ... static int tg3_test_interrupt ... return err; ...
    (Linux-Kernel)
  • [PATCH] pci_set_dac helper
    ... pci_set_dma_mask stuff wrong, occasionally in subtle ways. ... The attached patch demonstrates its use in tg3, ... static int __devinit pci_init ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)