From owner-freebsd-stable@FreeBSD.ORG Sat Oct 31 14:54:10 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46E2A106566B; Sat, 31 Oct 2009 14:54:10 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id D56068FC18; Sat, 31 Oct 2009 14:54:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by springbank.echomania.com (Postfix) with ESMTP id 5F0D5A70D5; Sat, 31 Oct 2009 15:54:08 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from springbank.echomania.com ([127.0.0.1]) by localhost (springbank.echomania.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BH2zo4TAp9Ti; Sat, 31 Oct 2009 15:53:50 +0100 (CET) Received: from [192.168.0.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id C9C3BA7085; Sat, 31 Oct 2009 15:53:50 +0100 (CET) Message-ID: <4AEC4F81.7010404@andric.com> Date: Sat, 31 Oct 2009 15:53:53 +0100 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.5pre) Gecko/20091027 Shredder/3.0pre MIME-Version: 1.0 To: freebsd-stable@freebsd.org, Andrew Thompson , Hans Petter Selasky References: <4AEC3823.9000204@andric.com> In-Reply-To: <4AEC3823.9000204@andric.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: Console has no name? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2009 14:54:10 -0000 On 2009-10-31 14:14, Dimitry Andric wrote: > Somewhere between r198312 and r198702 I started getting this message > during boot, on a machine using serial console: > > WARNING: console at 0xc093cea0 has no name Okay, this seems to be caused by r198655, which is an MFC of r197570, where experimental support for USB serial console was added. However, the consdev::cn_name field is never initialized in usb_serial.c, whereas this does happen in other console drivers. There doesn't seem to be a consensus whether this field needs to be initialized in the _cnprobe() or _cninit() functions: I count 9 instances of initialization in the former, and 3 in the latter. Is there a preferred way? Since _cnprobe seems more popular, I propose the following fix: Index: sys/dev/usb/serial/usb_serial.c =================================================================== --- sys/dev/usb/serial/usb_serial.c (revision 198702) +++ sys/dev/usb/serial/usb_serial.c (working copy) @@ -1301,6 +1301,7 @@ static void ucom_cnprobe(struct consdev *cp) { cp->cn_pri = CN_NORMAL; + strlcpy(cp->cn_name, "ucom", sizeof cp->cn_name); } static void