Date: Mon, 23 Mar 2015 23:06:33 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280403 - head/sys/dev/cxgbe Message-ID: <201503232306.t2NN6Xbi059626@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Mon Mar 23 23:06:32 2015 New Revision: 280403 URL: https://svnweb.freebsd.org/changeset/base/280403 Log: cxgbe(4): Do not call sbuf_trim on an sbuf with a drain function. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Mar 23 22:42:42 2015 (r280402) +++ head/sys/dev/cxgbe/t4_main.c Mon Mar 23 23:06:32 2015 (r280403) @@ -5080,13 +5080,16 @@ cxgbe_sysctls(struct port_info *pi) static int sysctl_int_array(SYSCTL_HANDLER_ARGS) { - int rc, *i; + int rc, *i, space = 0; struct sbuf sb; sbuf_new_for_sysctl(&sb, NULL, 64, req); - for (i = arg1; arg2; arg2 -= sizeof(int), i++) - sbuf_printf(&sb, "%d ", *i); - sbuf_trim(&sb); + for (i = arg1; arg2; arg2 -= sizeof(int), i++) { + if (space) + sbuf_printf(&sb, " "); + sbuf_printf(&sb, "%d", *i); + space = 1; + } rc = sbuf_finish(&sb); sbuf_delete(&sb); return (rc);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503232306.t2NN6Xbi059626>