diff mbox

[v4,01/22,SCSI] megaraid_sas: Use correct #define for MSI-X capability

Message ID E2CCFB5B3585F949A16AD87BA4CE34250338920277@cosmail02.lsi.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Radford, Adam April 22, 2013, 11:52 p.m. UTC
Bjorn, please post this patch to linux-scsi, where I will ACK it.

-Adam

-----Original Message-----
From: Bjorn Helgaas [mailto:bhelgaas@google.com] 
Sent: Monday, April 22, 2013 4:10 PM
To: linux-pci@vger.kernel.org
Cc: DL-MegaRAID Linux; Gavin Shan; James E.J. Bottomley
Subject: [PATCH v4 01/22] [SCSI] megaraid_sas: Use correct #define for MSI-X capability

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>
CC: Neela Syam Kolli <megaraidlinux@lsi.com>
CC: "James E.J. Bottomley" <JBottomley@parallels.com>
---
 drivers/scsi/megaraid/megaraid_sas.h      |    3 ---
 drivers/scsi/megaraid/megaraid_sas_base.c |    4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 408d254..684cc34 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -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 */
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 9d53540..7c90d57 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -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);
 			}