From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIi5o-0002SF-NE for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:26:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIi5g-0002PM-97 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:25:57 -0500 Received: from [199.232.76.173] (port=51290 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIi5f-0002PD-61 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:25:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2890) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIi5e-0003T1-Vn for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:25:51 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBACPnXv017298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Dec 2009 07:25:49 -0500 Date: Thu, 10 Dec 2009 14:23:05 +0200 From: "Michael S. Tsirkin" Message-ID: <20091210122305.GD13657@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B20E73E.6070408@redhat.com> Subject: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org 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. -- MST