summaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-04-30 10:44:54 +0300
committerBjorn Helgaas <bhelgaas@google.com>2013-04-30 08:49:19 -0700
commite5f66eafe5a4c678965a2138b92b645c2c0c4d10 (patch)
treecdeb95f80df8b5f282d5c5301f59f455664ea44e /drivers/pci/msi.c
parentab86e974f04b1cd827a9c7c35273834ebcd9ab38 (diff)
downloadlinux-e5f66eafe5a4c678965a2138b92b645c2c0c4d10.tar.bz2
PCI: Set ->mask_pos correctly
The "+" operation has higher precedence than "?:" and ->msi_cap is always non-zero here so the original statement is equivalent to: entry->mask_pos = PCI_MSI_MASK_64; Which wasn't the intent. [bhelgaas: my fault from 78b5a310ce] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d40bed726769..2c1075213bec 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -563,8 +563,10 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */
entry->msi_attrib.pos = dev->msi_cap;
- entry->mask_pos = dev->msi_cap + (control & PCI_MSI_FLAGS_64BIT) ?
- PCI_MSI_MASK_64 : PCI_MSI_MASK_32;
+ if (control & PCI_MSI_FLAGS_64BIT)
+ entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_64;
+ else
+ entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_32;
/* All MSIs are unmasked by default, Mask them all */
if (entry->msi_attrib.maskbit)
pci_read_config_dword(dev, entry->mask_pos, &entry->masked);