diff options
author | Robert P. J. Day <rpjday@mindspring.com> | 2007-02-10 04:45:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:27 -0500 |
commit | c376222960ae91d5ffb9197ee36771aaed1d9f90 (patch) | |
tree | 7f431c42529fec77433d33490bd9f2a8c47ba091 /net/core | |
parent | 1b135431abf5ea92e61bf4e91d93726c7b96da5f (diff) |
[PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc().
Replace appropriate pairs of "kmem_cache_alloc()" + "memset(0)" with the
corresponding "kmem_cache_zalloc()" call.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Roland McGrath <roland@redhat.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: Joel Becker <Joel.Becker@oracle.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Jan Kara <jack@ucw.cz>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: James Morris <jmorris@namei.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dst.c | 3 | ||||
-rw-r--r-- | net/core/neighbour.c | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 1a53fb39b7e0..f9eace78d354 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -132,10 +132,9 @@ void * dst_alloc(struct dst_ops * ops) | |||
132 | if (ops->gc()) | 132 | if (ops->gc()) |
133 | return NULL; | 133 | return NULL; |
134 | } | 134 | } |
135 | dst = kmem_cache_alloc(ops->kmem_cachep, GFP_ATOMIC); | 135 | dst = kmem_cache_zalloc(ops->kmem_cachep, GFP_ATOMIC); |
136 | if (!dst) | 136 | if (!dst) |
137 | return NULL; | 137 | return NULL; |
138 | memset(dst, 0, ops->entry_size); | ||
139 | atomic_set(&dst->__refcnt, 0); | 138 | atomic_set(&dst->__refcnt, 0); |
140 | dst->ops = ops; | 139 | dst->ops = ops; |
141 | dst->lastuse = jiffies; | 140 | dst->lastuse = jiffies; |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 054d46493d2b..efb673ad1854 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -251,12 +251,10 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl) | |||
251 | goto out_entries; | 251 | goto out_entries; |
252 | } | 252 | } |
253 | 253 | ||
254 | n = kmem_cache_alloc(tbl->kmem_cachep, GFP_ATOMIC); | 254 | n = kmem_cache_zalloc(tbl->kmem_cachep, GFP_ATOMIC); |
255 | if (!n) | 255 | if (!n) |
256 | goto out_entries; | 256 | goto out_entries; |
257 | 257 | ||
258 | memset(n, 0, tbl->entry_size); | ||
259 | |||
260 | skb_queue_head_init(&n->arp_queue); | 258 | skb_queue_head_init(&n->arp_queue); |
261 | rwlock_init(&n->lock); | 259 | rwlock_init(&n->lock); |
262 | n->updated = n->used = now; | 260 | n->updated = n->used = now; |