From owner-svn-src-all@freebsd.org Fri Dec 9 14:06:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E5CAC6EEB7; Fri, 9 Dec 2016 14:06:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6E2172C; Fri, 9 Dec 2016 14:06:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9E6Nvg091974; Fri, 9 Dec 2016 14:06:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9E6Nh9091973; Fri, 9 Dec 2016 14:06:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091406.uB9E6Nh9091973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 14:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309734 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 14:06:24 -0000 Author: hselasky Date: Fri Dec 9 14:06:22 2016 New Revision: 309734 URL: https://svnweb.freebsd.org/changeset/base/309734 Log: Avoid malloc() warnings when using the LinuxKPI by zero-checking the allocation flags. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Dec 9 13:53:31 2016 (r309733) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Dec 9 14:06:22 2016 (r309734) @@ -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: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Fri Dec 9 13:53:31 2016 (r309733) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Fri Dec 9 14:06:22 2016 (r309734) @@ -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)