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:
Hans Petter Selasky 2016-12-09 14:06:22 +00:00
parent 0a61267a99
commit be48ab92ac
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)