Add kzalloc() compatibility function
authormentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Thu, 24 Apr 2008 13:51:22 +0000 (13:51 +0000)
committermentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Thu, 24 Apr 2008 13:51:22 +0000 (13:51 +0000)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3571 0192ed92-7a03-0410-a25b-9323aeb14dbd

include/compat.h

index 2aafc7dc1a0990f81c8617a17b53b3c5b46ac95c..a9bf736abb3d2ef1ff166498a7582d55676b76d3 100644 (file)
 #define __force
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3)
+static inline void *kzalloc(size_t size, gfp_t flags)
+{
+       void *p = kmalloc(size, flags);
+       if (likely(p))
+               memset(p, 0, size);
+       return p;
+}
+#endif
+
 #ifndef container_of
 #define container_of(ptr, type, member) ({                             \
            const typeof( ((type *)0)->member ) *__mptr = (ptr);        \