Date: Mon, 16 Feb 2015 21:22:56 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278865 - head/sys/ofed/include/linux Message-ID: <201502162122.t1GLMuQ8055005@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502162122.t1GLMuQ8055005>