netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 05/11] bonding: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls
@ 2007-02-06  0:31 akpm
  2007-02-06  2:05 ` David Miller
  2007-02-06 22:17 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: akpm @ 2007-02-06  0:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, akpm, lkmaillist

From: "Joe Jin" <lkmaillist@gmail.com>

Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls in
the bonding driver.

Signed-off-by: Joe Jin <lkmaillist@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/net/bonding/bond_alb.c  |    4 +---
 drivers/net/bonding/bond_main.c |    4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff -puN drivers/net/bonding/bond_alb.c~bonding-replace-kmalloc-memset-pairs-with-the-appropriate-kzalloc-calls drivers/net/bonding/bond_alb.c
--- a/drivers/net/bonding/bond_alb.c~bonding-replace-kmalloc-memset-pairs-with-the-appropriate-kzalloc-calls
+++ a/drivers/net/bonding/bond_alb.c
@@ -184,7 +184,7 @@ static int tlb_initialize(struct bonding
 
 	spin_lock_init(&(bond_info->tx_hashtbl_lock));
 
-	new_hashtbl = kmalloc(size, GFP_KERNEL);
+	new_hashtbl = kzalloc(size, GFP_KERNEL);
 	if (!new_hashtbl) {
 		printk(KERN_ERR DRV_NAME
 		       ": %s: Error: Failed to allocate TLB hash table\n",
@@ -195,8 +195,6 @@ static int tlb_initialize(struct bonding
 
 	bond_info->tx_hashtbl = new_hashtbl;
 
-	memset(bond_info->tx_hashtbl, 0, size);
-
 	for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) {
 		tlb_init_table_entry(&bond_info->tx_hashtbl[i], 1);
 	}
diff -puN drivers/net/bonding/bond_main.c~bonding-replace-kmalloc-memset-pairs-with-the-appropriate-kzalloc-calls drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c~bonding-replace-kmalloc-memset-pairs-with-the-appropriate-kzalloc-calls
+++ a/drivers/net/bonding/bond_main.c
@@ -1343,14 +1343,12 @@ int bond_enslave(struct net_device *bond
 			"inaccurate.\n", bond_dev->name, slave_dev->name);
 	}
 
-	new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL);
+	new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
 	if (!new_slave) {
 		res = -ENOMEM;
 		goto err_undo_flags;
 	}
 
-	memset(new_slave, 0, sizeof(struct slave));
-
 	/* save slave's original flags before calling
 	 * netdev_set_master and dev_open
 	 */
_

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 05/11] bonding: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls
  2007-02-06  0:31 [patch 05/11] bonding: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls akpm
@ 2007-02-06  2:05 ` David Miller
  2007-02-06  2:45   ` Jeff Garzik
  2007-02-06 22:17 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2007-02-06  2:05 UTC (permalink / raw)
  To: akpm; +Cc: netdev, lkmaillist, jgarzik

From: akpm@linux-foundation.org
Date: Mon, 05 Feb 2007 16:31:04 -0800

> From: "Joe Jin" <lkmaillist@gmail.com>
> 
> Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls in
> the bonding driver.
> 
> Signed-off-by: Joe Jin <lkmaillist@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Jeff, you got this one?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 05/11] bonding: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls
  2007-02-06  2:05 ` David Miller
@ 2007-02-06  2:45   ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2007-02-06  2:45 UTC (permalink / raw)
  To: David Miller; +Cc: akpm, netdev, lkmaillist

David Miller wrote:
> From: akpm@linux-foundation.org
> Date: Mon, 05 Feb 2007 16:31:04 -0800
> 
>> From: "Joe Jin" <lkmaillist@gmail.com>
>>
>> Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls in
>> the bonding driver.
>>
>> Signed-off-by: Joe Jin <lkmaillist@gmail.com>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> Jeff, you got this one?

nope, didn't see it



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 05/11] bonding: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls
  2007-02-06  0:31 [patch 05/11] bonding: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls akpm
  2007-02-06  2:05 ` David Miller
@ 2007-02-06 22:17 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2007-02-06 22:17 UTC (permalink / raw)
  To: akpm; +Cc: netdev, lkmaillist

From: akpm@linux-foundation.org
Date: Mon, 05 Feb 2007 16:31:04 -0800

> From: "Joe Jin" <lkmaillist@gmail.com>
> 
> Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls in
> the bonding driver.
> 
> Signed-off-by: Joe Jin <lkmaillist@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Jeff asked me to take this so I have, applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-02-06 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-06  0:31 [patch 05/11] bonding: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls akpm
2007-02-06  2:05 ` David Miller
2007-02-06  2:45   ` Jeff Garzik
2007-02-06 22:17 ` David Miller

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).