All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available.
Date: Fri, 11 Dec 2009 12:37:31 +0200	[thread overview]
Message-ID: <20091211103731.GB29972@redhat.com> (raw)
In-Reply-To: <20091210191306.GE8739@redhat.com>

On Thu, Dec 10, 2009 at 09:13:06PM +0200, Gleb Natapov wrote:
> On Thu, Dec 10, 2009 at 08:04:56PM +0200, Michael S. Tsirkin wrote:
> > On Thu, Dec 10, 2009 at 03:22:52PM +0200, Gleb Natapov wrote:
> > > On Thu, Dec 10, 2009 at 02:23:05PM +0200, Michael S. Tsirkin wrote:
> > > > 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.
> > > > 
> > > ! is for boolean.
> > 
> > In which language? Not in C.
> > 
> In boolean. My point is no need to force your style on everyone

I am not forcing style on anyone - how can I do this?  I hacked on pci
and by now there's no == NULL in pci.c anywhere ;). I will be
happier if none is added now.

> if it is not in coding style document.

Heh, we don't need to document everything.

> == often much more readable then !.

Matter of taste probably.

> > > pci_dev is not boolean.
> > > --
> > > 			Gleb.
> 
> --
> 			Gleb.

  reply	other threads:[~2009-12-11 10:40 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
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 [this message]
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=20091211103731.GB29972@redhat.com \
    --to=mst@redhat.com \
    --cc=gleb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.