From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJ3Hg-0007n4-8p for qemu-devel@nongnu.org; Fri, 11 Dec 2009 06:03:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJ3Hc-0007i0-1L for qemu-devel@nongnu.org; Fri, 11 Dec 2009 06:03:39 -0500 Received: from [199.232.76.173] (port=47113 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJ3Hb-0007ho-LY for qemu-devel@nongnu.org; Fri, 11 Dec 2009 06:03:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30118) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJ3HZ-0002BG-O8 for qemu-devel@nongnu.org; Fri, 11 Dec 2009 06:03:34 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBBB3WUL032160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 Dec 2009 06:03:32 -0500 Date: Fri, 11 Dec 2009 13:03:30 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available. Message-ID: <20091211110330.GB23980@redhat.com> References: <1260439868-15061-1-git-send-email-kraxel@redhat.com> <1260439868-15061-3-git-send-email-kraxel@redhat.com> <20091210120806.GB13657@redhat.com> <4B20E73E.6070408@redhat.com> <20091210122305.GD13657@redhat.com> <20091210132252.GW7645@redhat.com> <20091210180455.GA20205@redhat.com> <20091210191306.GE8739@redhat.com> <20091211103731.GB29972@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091211103731.GB29972@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Gerd Hoffmann , qemu-devel@nongnu.org On Fri, Dec 11, 2009 at 12:37:31PM +0200, Michael S. Tsirkin wrote: > On Thu, Dec 10, 2009 at 09:13:06PM +0200, Gleb Natapov wrote: > > On Thu, Dec 10, 2009 at 08:04:56PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Dec 10, 2009 at 03:22:52PM +0200, Gleb Natapov wrote: > > > > On Thu, Dec 10, 2009 at 02:23:05PM +0200, Michael S. Tsirkin wrote: > > > > > On Thu, Dec 10, 2009 at 01:19:10PM +0100, Gerd Hoffmann wrote: > > > > > > Hi, > > > > > > > > > > > >>> + if (pci_dev == NULL) { > > > > > >>> + hw_error("PCI: can't register device\n"); > > > > > >>> + } > > > > > >> > > > > > >> Can you please use !pci_dev for these checks? > > > > > > > > > > > > Why? IMHO the code is more readable that way. It is easy to miss a > > > > > > single '!' character when reading the code, so I tend to write such > > > > > > tests in a more verbose fashion. > > > > > > > > > > > > cheers, > > > > > > Gerd > > > > > > > > > > Reader has limited short term memory. Don't fill it up with > > > > > irrelevant detail. In places where it might be confusing, > > > > > a comment might be appropriate, this is not one of them. > > > > > > > > > > C is a terse language. !x is a standard idiom. Let's use it. > > > > > > > > > ! is for boolean. > > > > > > In which language? Not in C. > > > > > In boolean. My point is no need to force your style on everyone > > I am not forcing style on anyone - how can I do this? I hacked on pci > and by now there's no == NULL in pci.c anywhere ;). I will be > happier if none is added now. > > > if it is not in coding style document. > > Heh, we don't need to document everything. > > > == often much more readable then !. > > Matter of taste probably. > Exactly! (Or should I say "Exactly=="?) -- Gleb.