From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 21:22:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E6B3BBA; Mon, 16 Feb 2015 21:22:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 57EC1259; Mon, 16 Feb 2015 21:22:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GLMvFC055007; Mon, 16 Feb 2015 21:22:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GLMuQ8055005; Mon, 16 Feb 2015 21:22:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502162122.t1GLMuQ8055005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 21:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278865 - head/sys/ofed/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.18-1 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: Mon, 16 Feb 2015 21:22:57 -0000 Author: hselasky Date: Mon Feb 16 21:22:56 2015 New Revision: 278865 URL: https://svnweb.freebsd.org/changeset/base/278865 Log: The kasprintf() function cannot be inlined due to using a variable number of arguments. Move it to a C-file in the linuxapi module to make the function usable. Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/ofed/include/linux/device.h head/sys/ofed/include/linux/linux_compat.c Modified: head/sys/ofed/include/linux/device.h ============================================================================== --- head/sys/ofed/include/linux/device.h Mon Feb 16 21:01:31 2015 (r278864) +++ head/sys/ofed/include/linux/device.h Mon Feb 16 21:22:56 2015 (r278865) @@ -431,17 +431,6 @@ static inline char *kvasprintf(gfp_t gfp return p; } -static inline char *kasprintf(gfp_t gfp, const char *fmt, ...) -{ - va_list ap; - char *p; - - va_start(ap, fmt); - p = kvasprintf(gfp, fmt, ap); - va_end(ap); - - return p; -} - +char *kasprintf(gfp_t, const char *, ...); #endif /* _LINUX_DEVICE_H_ */ Modified: head/sys/ofed/include/linux/linux_compat.c ============================================================================== --- head/sys/ofed/include/linux/linux_compat.c Mon Feb 16 21:01:31 2015 (r278864) +++ head/sys/ofed/include/linux/linux_compat.c Mon Feb 16 21:22:56 2015 (r278865) @@ -712,6 +712,20 @@ vunmap(void *addr) kfree(vmmap); } + +char * +kasprintf(gfp_t gfp, const char *fmt, ...) +{ + va_list ap; + char *p; + + va_start(ap, fmt); + p = kvasprintf(gfp, fmt, ap); + va_end(ap); + + return p; +} + static void linux_compat_init(void) {