[SCSI] megaraid_sas: Use correct #define for MSI-X capability
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 18 Apr 2013 00:08:44 +0000 (18:08 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 18 Apr 2013 17:07:46 +0000 (11:07 -0600)
Previously we used PCI_MSI_FLAGS to locate a register in the MSI-X
capability.  This did work because the MSI and MSI-X flags happen
to be at the same offsets, but was confusing.

PCI_MSIX_FLAGS_ENABLE is already defined in include/uapi/linux/pci_regs.h,
so no need to define it again.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Adam Radford <aradford@gmail.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c

index 408d2548a748af7c134a210fe687ad2e37663f62..684cc343cf09465aeceeb572af86d16827892e26 100644 (file)
@@ -1488,7 +1488,4 @@ struct megasas_mgmt_info {
        int max_index;
 };
 
-#define msi_control_reg(base) (base + PCI_MSI_FLAGS)
-#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
-
 #endif                         /*LSI_MEGARAID_SAS_H */
index 9d53540207ec6ef03e175ee875fcfbbdcf371f8e..7c90d57b867e2c332e1a953a3c01892f971bd779 100644 (file)
@@ -3984,12 +3984,12 @@ static int megasas_probe_one(struct pci_dev *pdev,
        if (reset_devices) {
                pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
                if (pos) {
-                       pci_read_config_word(pdev, msi_control_reg(pos),
+                       pci_read_config_word(pdev, pos + PCI_MSIX_FLAGS,
                                             &control);
                        if (control & PCI_MSIX_FLAGS_ENABLE) {
                                dev_info(&pdev->dev, "resetting MSI-X\n");
                                pci_write_config_word(pdev,
-                                                     msi_control_reg(pos),
+                                                     pos + PCI_MSIX_FLAGS,
                                                      control &
                                                      ~PCI_MSIX_FLAGS_ENABLE);
                        }