From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:13:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ED551065670; Tue, 17 Jan 2012 17:13:07 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2B43C8FC0C; Tue, 17 Jan 2012 17:13:05 +0000 (UTC) Received: by lahe6 with SMTP id e6so452185lah.13 for ; Tue, 17 Jan 2012 09:13:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=o1PAITWtmJnqcJmjQD/j4+jc7rm6oir8IxbLXu1ED3M=; b=qvuStx+uB6yohu2px+5jPXGsrMYC4izlnZH2o7ecNqovBxzdOrkzRtqHn499pLzXXX 57vcR5VbV/sx2ubjj5Rb6V6GeQxSRVAVdCIbpm8xxU09cLnfXN4R1gjMc93kvtmA6wAj 1BGDK9LxICKRja8gzVhh39DeGL8ejy4V20Jro= Received: by 10.112.39.138 with SMTP id p10mr4333290lbk.98.1326820385093; Tue, 17 Jan 2012 09:13:05 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.21.168 with HTTP; Tue, 17 Jan 2012 09:12:34 -0800 (PST) In-Reply-To: <201201171008.28752.jhb@freebsd.org> References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F136109.9050004@FreeBSD.org> <4F13621B.1060203@freebsd.org> <201201171008.28752.jhb@freebsd.org> From: Eitan Adler Date: Tue, 17 Jan 2012 12:12:34 -0500 X-Google-Sender-Auth: UGXj5adH7ia9xOY27kAfd-_-bhw Message-ID: To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 17 Jan 2012 17:13:07 -0000 On Tue, Jan 17, 2012 at 10:08 AM, John Baldwin wrote: > On Sunday, January 15, 2012 6:32:43 pm Colin Percival wrote: >> On 01/15/12 15:28, John Baldwin wrote: >> > On 1/15/12 2:09 AM, Eitan Adler wrote: >> >> Log: >> >> =C2=A0 =C2=A0- Fix undefined behavior when device_get_name is null >> >> =C2=A0 =C2=A0- Make error message more informative >> > >> > The in-kernel printf(9) always prints "(null)" for %s when the pointer= is NULL, >> > so that wasn't undefined behavior. =C2=A0Printing out the driver name = is a useful >> > change, but the "(unknown)" bits are just noise as it isn't clear that >> > "(unknown)" is substantially better than "(null)". >> >> I think the change from "(null)" to "(unknown)" is useful, since when I = see >> "(null)" printed my immediate thought is "looks like there's a bug I nee= d to >> track down here". > > The entire printf is "there's a bug I need to track down here". =C2=A0(nu= ll) > explicitly tells me that device_get_name() is NULL when looking at the pr= intf > to see what it means. =C2=A0Having it be (unknown) tells me the same exac= t thing, > but only after I've parsed an extra 2-3 lines of code to figure out what > (unknown) stands for. To me seeing "(null)" from the output of printf indicates "There is a bug here, printf should never be given a NULL argument.". However, given that it isn't undefined here, and the objections I've received I will revert this part of the change when I get home. --=20 Eitan Adler Ports committer X11, Bugbusting teams