Add kzalloc() compatibility function

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3571 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mentor 2008-04-24 13:51:22 +00:00
parent 0c14432118
commit 218abe13a6

View File

@ -56,6 +56,16 @@
#define __force #define __force
#endif #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 #ifndef container_of
#define container_of(ptr, type, member) ({ \ #define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \