Skip to contentSkip to conversation

x86/msi: Fold pci_conf_write16() calls in write_msi_msg()

PATCH In review Andrew Cooper 2 participants 2 messages Sep 22, 2020 – Sep 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/msi: Fold pci_conf_write16() calls in write_msi_msg()

In addition, this removes the unqualified 0/1 passed to msi_data_reg()

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>

---
 xen/arch/x86/msi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
xen/arch/x86/msi.c +2 -5
index a899c43e8d..5febc0ea4b 100644
@@ -214,13 +214,10 @@ static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         pci_conf_write32(dev->sbdf, msi_lower_address_reg(pos),
                          msg->address_lo);
         if ( entry->msi_attrib.is_64 )
-        {
             pci_conf_write32(dev->sbdf, msi_upper_address_reg(pos),
                              msg->address_hi);
-            pci_conf_write16(dev->sbdf, msi_data_reg(pos, 1), msg->data);
-        }
-        else
-            pci_conf_write16(dev->sbdf, msi_data_reg(pos, 0), msg->data);
+        pci_conf_write16(dev->sbdf, msi_data_reg(pos, entry->msi_attrib.is_64),
+                         msg->data);
         break;
     }
     case PCI_CAP_ID_MSIX:
Signature · 1 line
2.11.0