]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/dst.c
[ARM] 4331/3: Support for Micrel/Kendin KS8695 processor
[linux-2.6-omap-h63xx.git] / net / core / dst.c
index 1a53fb39b7e008efa67709bcd4ac984426e064df..764bccb3d99265b2a014b41167d999cf1574e639 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
-#include <linux/sched.h>
 #include <linux/skbuff.h>
 #include <linux/string.h>
 #include <linux/types.h>
@@ -29,7 +28,7 @@
  * 4) All operations modify state, so a spinlock is used.
  */
 static struct dst_entry        *dst_garbage_list;
-#if RT_CACHE_DEBUG >= 2 
+#if RT_CACHE_DEBUG >= 2
 static atomic_t                         dst_total = ATOMIC_INIT(0);
 #endif
 static DEFINE_SPINLOCK(dst_lock);
@@ -132,17 +131,16 @@ void * dst_alloc(struct dst_ops * ops)
                if (ops->gc())
                        return NULL;
        }
-       dst = kmem_cache_alloc(ops->kmem_cachep, GFP_ATOMIC);
+       dst = kmem_cache_zalloc(ops->kmem_cachep, GFP_ATOMIC);
        if (!dst)
                return NULL;
-       memset(dst, 0, ops->entry_size);
        atomic_set(&dst->__refcnt, 0);
        dst->ops = ops;
        dst->lastuse = jiffies;
        dst->path = dst;
        dst->input = dst_discard_in;
        dst->output = dst_discard_out;
-#if RT_CACHE_DEBUG >= 2 
+#if RT_CACHE_DEBUG >= 2
        atomic_inc(&dst_total);
 #endif
        atomic_inc(&ops->entries);
@@ -203,7 +201,7 @@ again:
                dst->ops->destroy(dst);
        if (dst->dev)
                dev_put(dst->dev);
-#if RT_CACHE_DEBUG >= 2 
+#if RT_CACHE_DEBUG >= 2
        atomic_dec(&dst_total);
 #endif
        kmem_cache_free(dst->ops->kmem_cachep, dst);