Re: [PATCH v4 03/11] PCI: pciehp: Use RMW accessors for changing LNKCTL

From: Andy Shevchenko
Date: Fri Jul 14 2023 - 04:58:19 EST


On Thu, Jul 13, 2023 at 03:44:57PM +0300, Ilpo Järvinen wrote:
> As hotplug is not the only driver touching LNKCTL, use the RMW
> capability accessor which handles concurrent changes correctly.

...

> + pcie_capability_clear_and_set_word(pdev, PCI_EXP_LNKCTL,
> + PCI_EXP_LNKCTL_LD,
> + !enable ? PCI_EXP_LNKCTL_LD : 0);

enable ? 0 : PCI_EXP_LNKCTL_LD);

easier to read and get.

--
With Best Regards,
Andy Shevchenko