From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bZX-0003Xb-Nt for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:38:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bZU-0004aC-FK for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:38:31 -0500 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:36614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bZU-0004a7-CM for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:38:28 -0500 Received: by mail-qk0-x22f.google.com with SMTP id t125so100696941qkh.3 for ; Thu, 17 Dec 2015 08:38:28 -0800 (PST) Sender: Richard Henderson References: <1450354795-31608-1-git-send-email-armbru@redhat.com> <1450354795-31608-12-git-send-email-armbru@redhat.com> <20151217153756-mutt-send-email-mst@redhat.com> <877fkdjgkn.fsf@blackfin.pond.sub.org> From: Richard Henderson Message-ID: <5672E500.3000907@twiddle.net> Date: Thu, 17 Dec 2015 08:38:24 -0800 MIME-Version: 1.0 In-Reply-To: <877fkdjgkn.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 11/13] isa: Clean up inappropriate hw_error() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , "Michael S. Tsirkin" Cc: =?UTF-8?Q?Herv=c3=a9_Poussineau?= , Mark Cave-Ayland , qemu-devel@nongnu.org, Aurelien Jarno On 12/17/2015 06:27 AM, Markus Armbruster wrote: > "Michael S. Tsirkin" writes: > >> On Thu, Dec 17, 2015 at 01:19:53PM +0100, Markus Armbruster wrote: >>> isa_bus_irqs(), isa_create() and isa_try_create() call hw_error() when >>> passed a null bus. Use of hw_error() has always been questionable, >>> because these are used only during machine initialization, and >>> printing CPU registers isn't useful there. >>> >>> Since the previous commit, passing a null bus is a programming error. >>> Drop the hw_error() and simply let it crash. >>> >>> Cc: Richard Henderson >>> Cc: "Michael S. Tsirkin" >>> Cc: "Hervé Poussineau" >>> Cc: Aurelien Jarno >>> Cc: Mark Cave-Ayland >>> Signed-off-by: Markus Armbruster >>> Reviewed-by: Hervé Poussineau >> >> I'd prefer an assert just in case. > > I understand "prefer", I don't understand "just in case" :) > > Adding an assertion here merely converts one kind of crash into another. > > Doesn't make anything safer, not even just in case something happens we > thought was impossible. > > Does print a message before crashing that some developers may find > useful. > > Might make our belief that null can't happen a bit more explicit. > > My own preference is not to assert the blatantly obvious. However, I'm > certainly willing to defer to a maintainer's or reviewer's preference, > within reason. For what it's worth: I'm not a fan of sprinkling obvious assertions everywhere either. I think the patch is fine as-is. Reviewed-by: Richard Henderson r~