linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Airlie <airlied@redhat.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org
Subject: Re: Coverity CID 142811: pci_set_vga_state() operands don't affect result
Date: Thu, 3 Apr 2014 20:12:44 -0400 (EDT)	[thread overview]
Message-ID: <1888467261.2661221.1396570364156.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAE9FiQUHC4jPJttUpChAALd6zubbQQEZ9wRc329Lv5QAXGOUKw@mail.gmail.com>



----- Original Message -----
> From: "Yinghai Lu" <yinghai@kernel.org>
> To: "Bjorn Helgaas" <bhelgaas@google.com>
> Cc: "Dave Airlie" <airlied@redhat.com>, linux-pci@vger.kernel.org
> Sent: Friday, 4 April, 2014 10:06:32 AM
> Subject: Re: Coverity CID 142811: pci_set_vga_state() operands don't affect result
> 
> On Thu, Apr 3, 2014 at 1:43 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> > Coverity complains about this in drivers/pci/pci.c:
> >
> > CID 142811 (#1 of 1): Operands don't affect result
> > (CONSTANT_EXPRESSION_RESULT)
> > result_independent_of_operands: flags & (2U /* 1 << 1 */) &
> > (command_bits & 4294967292U /* ~(1 | 2) */) is always 0 regardless of
> > the values of its operands. This occurs as the logical operand of if.
> >
> > 4128        WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) &
> > (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
> >
> > This is a result of 3448a19da479 "vgaarb: use bridges to control VGA
> > routing where possible."
> >
> > I wonder if that middle "&" was intended to be "&&"?
> 
> must be. otherwise always get 0.

Yeah I'd agree :-)

Dave.

  reply	other threads:[~2014-04-04  0:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 20:43 Coverity CID 142811: pci_set_vga_state() operands don't affect result Bjorn Helgaas
2014-04-04  0:06 ` Yinghai Lu
2014-04-04  0:12   ` David Airlie [this message]
2014-04-04 15:47 ` Bjorn Helgaas
2014-04-25 17:21   ` Bjorn Helgaas

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=1888467261.2661221.1396570364156.JavaMail.zimbra@redhat.com \
    --to=airlied@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=yinghai@kernel.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).