Skip to content

Commit 911afb9

Browse files
Ajay Agarwalbjorn-helgaas
authored andcommitted
PCI/ASPM: Remove unnecessary ASPM_STATE_L1SS check
Previously aspm_l1ss_init() checked if ASPM_STATE_L1SS is supported before calling aspm_calc_l12_info(), only for that function to return if ASPM_STATE_L1_2_MASK is not supported. Simplify the logic by directly checking for ASPM_STATE_L1_2_MASK. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ajay Agarwal <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 05a55d9 commit 911afb9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/pci/pcie/aspm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,6 @@ static void aspm_calc_l12_info(struct pcie_link_state *link,
481481
u32 pctl1, pctl2, cctl1, cctl2;
482482
u32 pl1_2_enables, cl1_2_enables;
483483

484-
if (!(link->aspm_support & ASPM_STATE_L1_2_MASK))
485-
return;
486-
487484
/* Choose the greater of the two Port Common_Mode_Restore_Times */
488485
val1 = (parent_l1ss_cap & PCI_L1SS_CAP_CM_RESTORE_TIME) >> 8;
489486
val2 = (child_l1ss_cap & PCI_L1SS_CAP_CM_RESTORE_TIME) >> 8;
@@ -616,7 +613,7 @@ static void aspm_l1ss_init(struct pcie_link_state *link)
616613
if (parent_l1ss_ctl1 & child_l1ss_ctl1 & PCI_L1SS_CTL1_PCIPM_L1_2)
617614
link->aspm_enabled |= ASPM_STATE_L1_2_PCIPM;
618615

619-
if (link->aspm_support & ASPM_STATE_L1SS)
616+
if (link->aspm_support & ASPM_STATE_L1_2_MASK)
620617
aspm_calc_l12_info(link, parent_l1ss_cap, child_l1ss_cap);
621618
}
622619

0 commit comments

Comments
 (0)