Avoid malloc() warnings when using the LinuxKPI by zero-checking
the allocation flags. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC after: 1 week
This commit is contained in:
parent
0a61267a99
commit
be48ab92ac
@ -64,7 +64,7 @@
|
||||
#define GFP_IOFS M_NOWAIT
|
||||
#define GFP_NOIO M_NOWAIT
|
||||
#define GFP_DMA32 0
|
||||
#define GFP_TEMPORARY 0
|
||||
#define GFP_TEMPORARY M_NOWAIT
|
||||
|
||||
static inline void *
|
||||
page_address(struct page *page)
|
||||
|
@ -43,7 +43,7 @@ MALLOC_DECLARE(M_KMALLOC);
|
||||
|
||||
#define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags))
|
||||
#define kvmalloc(size) kmalloc((size), 0)
|
||||
#define kzalloc(size, flags) kmalloc((size), (flags) | M_ZERO)
|
||||
#define kzalloc(size, flags) kmalloc((size), M_ZERO | ((flags) ? (flags) : M_NOWAIT))
|
||||
#define kzalloc_node(size, flags, node) kzalloc(size, flags)
|
||||
#define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC)
|
||||
#define kfree_const(ptr) kfree(ptr)
|
||||
|
Loading…
x
Reference in New Issue
Block a user