mirror of
https://github.com/proski/madwifi
synced 2024-11-25 15:59:39 +03:00
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:
parent
0c14432118
commit
218abe13a6
@ -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); \
|
||||||
|
Loading…
Reference in New Issue
Block a user