Re: [PATCH 1/1] PCI/ASPM: Remove pcie_aspm_enabled() unnecessary locking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 10, 2019 at 04:01:21PM +0200, Christoph Hellwig wrote:
> On Thu, Oct 10, 2019 at 07:47:46AM -0500, Bjorn Helgaas wrote:
> > +	return bridge->link_state ? !!bridge->link_state->aspm_enabled : false;
> 
> Can we unobsfucated this while we're at it?
> 
> 	if (!bridge->link_state)
> 		return false;
> 	return bridge->link_state->aspm_enabled;

Yep, after some of the follow-up patches from Heiner, it looks like
this:

  bool pcie_aspm_enabled(struct pci_dev *pdev)
  {
	  struct pcie_link_state *link = pcie_aspm_get_link(pdev);

	  if (!link)
		  return false;

	  return link->aspm_enabled;
  }




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux