[Top][All Lists]
[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: |
Michael S. Tsirkin |
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 14:23:05 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
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
- [Qemu-devel] [FOR 0.12 PATCH 0/4] misc bugfixes, Gerd Hoffmann, 2009/12/10
- [Qemu-devel] [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gerd Hoffmann, 2009/12/10
- [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Michael S. Tsirkin, 2009/12/10
- [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gerd Hoffmann, 2009/12/10
- [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available.,
Michael S. Tsirkin <=
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gleb Natapov, 2009/12/10
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Michael S. Tsirkin, 2009/12/10
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gleb Natapov, 2009/12/10
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Michael S. Tsirkin, 2009/12/11
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gleb Natapov, 2009/12/11
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Alexander Graf, 2009/12/10
[Qemu-devel] [FOR 0.12 PATCH 1/4] pci: don't abort() when trying to hotplug with acpi off., Gerd Hoffmann, 2009/12/10
[Qemu-devel] [FOR 0.12 PATCH 3/4] scsi: fix drive hotplug., Gerd Hoffmann, 2009/12/10
[Qemu-devel] [FOR 0.12 PATCH 4/4] QemuOpts: allow larger option values., Gerd Hoffmann, 2009/12/10
[Qemu-devel] Re: [FOR 0.12 PATCH 0/4] misc bugfixes, Michael S. Tsirkin, 2009/12/10