Date: Mon, 19 Dec 2016 09:40:29 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310245 - stable/11/sys/compat/linuxkpi/common/include/linux Message-ID: <201612190940.uBJ9eThw082697@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Dec 19 09:40:29 2016 New Revision: 310245 URL: https://svnweb.freebsd.org/changeset/base/310245 Log: MFC r309734: Avoid malloc() warnings when using the LinuxKPI by zero-checking the allocation flags. Obtained from: kmacy @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Mon Dec 19 09:38:34 2016 (r310244) +++ stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Mon Dec 19 09:40:29 2016 (r310245) @@ -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) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Mon Dec 19 09:38:34 2016 (r310244) +++ stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Mon Dec 19 09:40:29 2016 (r310245) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612190940.uBJ9eThw082697>