qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot


From: Gerd Hoffmann
Subject: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available.
Date: Thu, 10 Dec 2009 13:19:10 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4

  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]