Skip to contentSkip to conversation

pcie.c:148: possible error in OR expression ?

Qemu-devel dcb 1 participant 2 messages Nov 17, 2014 – Jun 23, 2016

lore
Share & tools
lore

dcb

author
#0 lore raw

Public bug reported:

[qemu/hw/pci/pcie.c:148] -> [qemu/hw/pci/pcie.c:148]: (style) Same expression on both sides of '|'.

    pci_long_test_and_set_mask(dev->w1cmask + pos + PCI_EXP_DEVSTA,
                               PCI_EXP_DEVSTA_CED | PCI_EXP_DEVSTA_NFED |
                               PCI_EXP_DEVSTA_URD | PCI_EXP_DEVSTA_URD);

I am guessing that something like

    pci_long_test_and_set_mask(dev->w1cmask + pos + PCI_EXP_DEVSTA,
                               PCI_EXP_DEVSTA_CED | PCI_EXP_DEVSTA_NFED |
                               PCI_EXP_DEVSTA_FED | PCI_EXP_DEVSTA_URD);

was intended.

I used static analyser cppcheck to find this bug.

** Affects: qemu
Importance: Undecided
Status: New

Signature · 30 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1393440

Title:
  pcie.c:148: possible error in OR expression ?

Status in QEMU:
  New

Bug description:
  [qemu/hw/pci/pcie.c:148] -> [qemu/hw/pci/pcie.c:148]: (style) Same
  expression on both sides of '|'.

      pci_long_test_and_set_mask(dev->w1cmask + pos + PCI_EXP_DEVSTA,
                                 PCI_EXP_DEVSTA_CED | PCI_EXP_DEVSTA_NFED |
                                 PCI_EXP_DEVSTA_URD | PCI_EXP_DEVSTA_URD);

  I am guessing that something like

      pci_long_test_and_set_mask(dev->w1cmask + pos + PCI_EXP_DEVSTA,
                                 PCI_EXP_DEVSTA_CED | PCI_EXP_DEVSTA_NFED |
                                 PCI_EXP_DEVSTA_FED | PCI_EXP_DEVSTA_URD);

  was intended.

  I used static analyser cppcheck to find this bug.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1393440/+subscriptions
author
#1 lore raw

Fixed here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=8e815eeefe205155f5

** Changed in: qemu
Status: New => Fix Released

Signature · 30 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1393440

Title:
  pcie.c:148: possible error in OR expression ?

Status in QEMU:
  Fix Released

Bug description:
  [qemu/hw/pci/pcie.c:148] -> [qemu/hw/pci/pcie.c:148]: (style) Same
  expression on both sides of '|'.

      pci_long_test_and_set_mask(dev->w1cmask + pos + PCI_EXP_DEVSTA,
                                 PCI_EXP_DEVSTA_CED | PCI_EXP_DEVSTA_NFED |
                                 PCI_EXP_DEVSTA_URD | PCI_EXP_DEVSTA_URD);

  I am guessing that something like

      pci_long_test_and_set_mask(dev->w1cmask + pos + PCI_EXP_DEVSTA,
                                 PCI_EXP_DEVSTA_CED | PCI_EXP_DEVSTA_NFED |
                                 PCI_EXP_DEVSTA_FED | PCI_EXP_DEVSTA_URD);

  was intended.

  I used static analyser cppcheck to find this bug.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1393440/+subscriptions