qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <20091210122305.GD13657@redhat.com> (raw)
In-Reply-To: <4B20E73E.6070408@redhat.com>

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

  reply	other threads:[~2009-12-10 12:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-10 10:11 [Qemu-devel] [FOR 0.12 PATCH 0/4] misc bugfixes Gerd Hoffmann
2009-12-10 10:11 ` [Qemu-devel] [FOR 0.12 PATCH 1/4] pci: don't abort() when trying to hotplug with acpi off Gerd Hoffmann
2009-12-10 10:11 ` [Qemu-devel] [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available Gerd Hoffmann
2009-12-10 12:08   ` [Qemu-devel] " Michael S. Tsirkin
2009-12-10 12:19     ` Gerd Hoffmann
2009-12-10 12:23       ` Michael S. Tsirkin [this message]
2009-12-10 13:22         ` Gleb Natapov
2009-12-10 18:04           ` Michael S. Tsirkin
2009-12-10 19:13             ` Gleb Natapov
2009-12-11 10:37               ` Michael S. Tsirkin
2009-12-11 11:03                 ` Gleb Natapov
2009-12-10 12:33     ` Alexander Graf
2009-12-10 10:11 ` [Qemu-devel] [FOR 0.12 PATCH 3/4] scsi: fix drive hotplug Gerd Hoffmann
2009-12-10 10:11 ` [Qemu-devel] [FOR 0.12 PATCH 4/4] QemuOpts: allow larger option values Gerd Hoffmann
2009-12-10 12:03 ` [Qemu-devel] Re: [FOR 0.12 PATCH 0/4] misc bugfixes Michael S. Tsirkin
2009-12-10 12:15   ` Gerd Hoffmann
2009-12-10 15:37   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091210122305.GD13657@redhat.com \
    --to=mst@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).