From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIhzN-0007dZ-CQ for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:19:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIhzI-0007Yh-6t for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:19:20 -0500 Received: from [199.232.76.173] (port=40498 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIhzH-0007YN-PJ for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:19:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35425) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIhzH-0002xH-H7 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 07:19:15 -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 nBACJEKF011985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Dec 2009 07:19:14 -0500 Message-ID: <4B20E73E.6070408@redhat.com> Date: Thu, 10 Dec 2009 13:19:10 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1260439868-15061-1-git-send-email-kraxel@redhat.com> <1260439868-15061-3-git-send-email-kraxel@redhat.com> <20091210120806.GB13657@redhat.com> In-Reply-To: <20091210120806.GB13657@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org 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