From owner-svn-src-all@FreeBSD.ORG Fri Feb 27 13:28:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA4A3106566B; Fri, 27 Feb 2009 13:28:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D970E8FC17; Fri, 27 Feb 2009 13:28:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1RDSsDj071574; Fri, 27 Feb 2009 13:28:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1RDSsMu071573; Fri, 27 Feb 2009 13:28:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902271328.n1RDSsMu071573@svn.freebsd.org> From: Ed Schouten Date: Fri, 27 Feb 2009 13:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189104 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 27 Feb 2009 13:28:55 -0000 Author: ed Date: Fri Feb 27 13:28:54 2009 New Revision: 189104 URL: http://svn.freebsd.org/changeset/base/189104 Log: Remove redundant code in printf() and vprintf(). printf() and vprintf() are exactly the same, except the way arguments are passed. Just like we see in other pieces of code (i.e. libc's printf()), implement printf() using vprintf(). Submitted by: Christoph Mallon Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Feb 27 13:22:26 2009 (r189103) +++ head/sys/kern/subr_prf.c Fri Feb 27 13:28:54 2009 (r189104) @@ -295,39 +295,12 @@ int printf(const char *fmt, ...) { va_list ap; - struct putchar_arg pca; int retval; -#ifdef PRINTF_BUFR_SIZE - char bufr[PRINTF_BUFR_SIZE]; -#endif va_start(ap, fmt); - pca.tty = NULL; - pca.flags = TOCONS | TOLOG; - pca.pri = -1; -#ifdef PRINTF_BUFR_SIZE - pca.p_bufr = bufr; - pca.p_next = pca.p_bufr; - pca.n_bufr = sizeof(bufr); - pca.remain = sizeof(bufr); - *pca.p_next = '\0'; -#else - /* Don't buffer console output. */ - pca.p_bufr = NULL; -#endif - - retval = kvprintf(fmt, putchar, &pca, 10, ap); + retval = vprintf(fmt, ap); va_end(ap); -#ifdef PRINTF_BUFR_SIZE - /* Write any buffered console output: */ - if (*pca.p_bufr != '\0') - cnputs(pca.p_bufr); -#endif - - if (!panicstr) - msgbuftrigger = 1; - return (retval); }