svn commit: r280403 - head/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Mon Mar 23 23:06:34 UTC 2015
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);
More information about the svn-src-all
mailing list