linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Coverity CID 142811: pci_set_vga_state() operands don't affect result
@ 2014-04-03 20:43 Bjorn Helgaas
  2014-04-04  0:06 ` Yinghai Lu
  2014-04-04 15:47 ` Bjorn Helgaas
  0 siblings, 2 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2014-04-03 20:43 UTC (permalink / raw)
  To: Dave Airlie; +Cc: linux-pci@vger.kernel.org

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 "&&"?

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-25 17:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-04-04 15:47 ` Bjorn Helgaas
2014-04-25 17:21   ` Bjorn Helgaas

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).