From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 4/4] pci: interrupt disable bit support
Date: Thu, 26 Nov 2009 15:21:52 +0200 [thread overview]
Message-ID: <20091126132152.GA31817@redhat.com> (raw)
In-Reply-To: <20091126030451.GG25483%yamahata@valinux.co.jp>
On Thu, Nov 26, 2009 at 12:04:51PM +0900, Isaku Yamahata wrote:
> On Wed, Nov 25, 2009 at 06:59:06PM +0200, Michael S. Tsirkin wrote:
> > interrupt disable bit is mandatory in PCI spec,
> > so we must implement it to be spec compliant.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > hw/pci.c | 57 ++++++++++++++++++++++++++++++++++++++++-----------------
> > hw/pci.h | 4 ++++
> > 2 files changed, 44 insertions(+), 17 deletions(-)
> >
> > diff --git a/hw/pci.c b/hw/pci.c
> > index 844664b..3daae46 100644
> > --- a/hw/pci.c
> > +++ b/hw/pci.c
> > @@ -114,12 +114,43 @@ static void pci_update_irq_status(PCIDevice *dev)
> > }
> > }
> >
> > +static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change)
> > +{
> > + PCIBus *bus;
> > + for (;;) {
> > + bus = pci_dev->bus;
> > + irq_num = bus->map_irq(pci_dev, irq_num);
> > + if (bus->set_irq)
> > + break;
> > + pci_dev = bus->parent_dev;
> > + }
> > + bus->irq_count[irq_num] += change;
> > + bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0);
>
> Let's use ! instead of != 0 for consistency.
By the way, this would have to be !!, not !.
So not sure there's much consistency to be gained:
!= appears in pci.c more times than !!.
--
MST
prev parent reply other threads:[~2009-11-26 13:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1259168040.git.mst@redhat.com>
2009-11-25 16:58 ` [Qemu-devel] [PATCH 1/4] pci: rearrange code for interrupts Michael S. Tsirkin
2009-11-25 16:58 ` [Qemu-devel] [PATCH 2/4] pci: track IRQ status Michael S. Tsirkin
2009-11-25 16:58 ` [Qemu-devel] [PATCH 3/4] pci: interrupt status bit implementation Michael S. Tsirkin
2009-11-25 16:59 ` [Qemu-devel] [PATCH 4/4] pci: interrupt disable bit support Michael S. Tsirkin
2009-11-26 3:04 ` [Qemu-devel] " Isaku Yamahata
2009-11-26 9:53 ` Michael S. Tsirkin
2009-11-26 12:38 ` Michael S. Tsirkin
2009-11-26 13:21 ` Michael S. Tsirkin [this message]
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=20091126132152.GA31817@redhat.com \
--to=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yamahata@valinux.co.jp \
/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.