From owner-svn-src-head@FreeBSD.ORG Tue Oct 28 03:42:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37733437; Tue, 28 Oct 2014 03:42:10 +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 0897933C; Tue, 28 Oct 2014 03:42:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9S3g9Ix079230; Tue, 28 Oct 2014 03:42:09 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S3g9oJ079229; Tue, 28 Oct 2014 03:42:09 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201410280342.s9S3g9oJ079229@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 28 Oct 2014 03:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273761 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 03:42:10 -0000 Author: araujo (ports committer) Date: Tue Oct 28 03:42:09 2014 New Revision: 273761 URL: https://svnweb.freebsd.org/changeset/base/273761 Log: Drop __DECONST as well as few fixes of style(9). Phabric: D1012 Suggested by: mjg, jhb Reviewed by: mjg, jhb Sponsored by: QNAP Systems Inc. Modified: head/sys/dev/uart/uart_subr.c Modified: head/sys/dev/uart/uart_subr.c ============================================================================== --- head/sys/dev/uart/uart_subr.c Tue Oct 28 02:05:57 2014 (r273760) +++ head/sys/dev/uart/uart_subr.c Tue Oct 28 03:42:09 2014 (r273761) @@ -196,7 +196,8 @@ out: int uart_getenv(int devtype, struct uart_devinfo *di, struct uart_class *class) { - const char *cp, *spec; + const char *spec; + char *cp; bus_addr_t addr = ~0U; int error; @@ -213,12 +214,18 @@ uart_getenv(int devtype, struct uart_dev * which UART port is to be used as serial console or debug * port (resp). */ - if (devtype == UART_DEV_CONSOLE) + switch (devtype) { + case UART_DEV_CONSOLE: cp = kern_getenv("hw.uart.console"); - else if (devtype == UART_DEV_DBGPORT) + break; + case UART_DEV_DBGPORT: cp = kern_getenv("hw.uart.dbgport"); - else + break; + default: cp = NULL; + break; + } + if (cp == NULL) return (ENXIO); @@ -233,7 +240,7 @@ uart_getenv(int devtype, struct uart_dev /* Parse the attributes. */ spec = cp; - while (1) { + for (;;) { switch (uart_parse_tag(&spec)) { case UART_TAG_BR: di->baudrate = uart_parse_long(&spec); @@ -268,18 +275,18 @@ uart_getenv(int devtype, struct uart_dev di->bas.rclk = uart_parse_long(&spec); break; default: - freeenv(__DECONST(char *, cp)); + freeenv(cp); return (EINVAL); } if (*spec == '\0') break; if (*spec != ',') { - freeenv(__DECONST(char *, cp)); + freeenv(cp); return (EINVAL); } spec++; } - freeenv(__DECONST(char *, cp)); + freeenv(cp); /* * If we still have an invalid address, the specification must be