Skip to content

Commit 6552e90

Browse files
committed
PCI: hv: Switch MSI descriptor locking to guard()
Convert the code to use the new guard(msi_descs_lock). No functional change intended. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Acked-by: Wei Liu <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 8911466 commit 6552e90

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/pci/controller/pci-hyperv.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,24 +3975,18 @@ static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg)
39753975
{
39763976
struct irq_data *irq_data;
39773977
struct msi_desc *entry;
3978-
int ret = 0;
39793978

39803979
if (!pdev->msi_enabled && !pdev->msix_enabled)
39813980
return 0;
39823981

3983-
msi_lock_descs(&pdev->dev);
3982+
guard(msi_descs_lock)(&pdev->dev);
39843983
msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) {
39853984
irq_data = irq_get_irq_data(entry->irq);
3986-
if (WARN_ON_ONCE(!irq_data)) {
3987-
ret = -EINVAL;
3988-
break;
3989-
}
3990-
3985+
if (WARN_ON_ONCE(!irq_data))
3986+
return -EINVAL;
39913987
hv_compose_msi_msg(irq_data, &entry->msg);
39923988
}
3993-
msi_unlock_descs(&pdev->dev);
3994-
3995-
return ret;
3989+
return 0;
39963990
}
39973991

39983992
/*

0 commit comments

Comments
 (0)