Skip to content

Commit 50410ba

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 1bc7e26 commit 50410ba

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
@@ -3976,24 +3976,18 @@ static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg)
39763976
{
39773977
struct irq_data *irq_data;
39783978
struct msi_desc *entry;
3979-
int ret = 0;
39803979

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

3984-
msi_lock_descs(&pdev->dev);
3983+
guard(msi_descs_lock)(&pdev->dev);
39853984
msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) {
39863985
irq_data = irq_get_irq_data(entry->irq);
3987-
if (WARN_ON_ONCE(!irq_data)) {
3988-
ret = -EINVAL;
3989-
break;
3990-
}
3991-
3986+
if (WARN_ON_ONCE(!irq_data))
3987+
return -EINVAL;
39923988
hv_compose_msi_msg(irq_data, &entry->msg);
39933989
}
3994-
msi_unlock_descs(&pdev->dev);
3995-
3996-
return ret;
3990+
return 0;
39973991
}
39983992

39993993
/*

0 commit comments

Comments
 (0)