Two of aspm_calc_l1ss_info()'s arguments are now redundant. All members of struct aspm_register_info are now calculated directly, so both the struct and pcie_get_aspm_reg() are now useless. - Remove redundant arguments in aspm_calc_l1ss_info(). - Refactor callers to also remove redundant parameters - Remove any remaining call to pcie_get_aspm_reg() - Remove pcie_get_aspm_reg() - Remove remaining reference to struct aspm_register_info. - Remove struct aspm_register_info Signed-off-by: Saheed O. Bolarinwa <refactormyself@xxxxxxxxx> --- drivers/pci/pcie/aspm.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index e43fdf0cd08c..f4fc2d65240c 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -382,17 +382,6 @@ static void encode_l12_threshold(u32 threshold_us, u32 *scale, u32 *value) } } -struct aspm_register_info { -}; - -static void pcie_get_aspm_reg(struct pci_dev *pdev, - struct aspm_register_info *info) -{ - u16 ctl; - - pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &ctl); -} - static void pcie_aspm_check_latency(struct pci_dev *endpoint) { u32 latency, l1_switch_latency = 0; @@ -455,9 +444,7 @@ static struct pci_dev *pci_function_0(struct pci_bus *linkbus) } /* Calculate L1.2 PM substate timing parameters */ -static void aspm_calc_l1ss_info(struct pcie_link_state *link, - struct aspm_register_info *upreg, - struct aspm_register_info *dwreg) +static void aspm_calc_l1ss_info(struct pcie_link_state *link) { u32 val1, val2, scale1, scale2; u32 t_common_mode, t_power_on, l1_2_threshold, scale, value; @@ -523,7 +510,6 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) { struct pci_dev *child = link->downstream, *parent = link->pdev; struct pci_bus *linkbus = parent->subordinate; - struct aspm_register_info upreg, dwreg; u32 up_l1ss_ctl1, dw_l1ss_ctl1; if (blacklist) { @@ -595,7 +581,7 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) link->aspm_enabled |= ASPM_STATE_L1_2_PCIPM; if (link->aspm_support & ASPM_STATE_L1SS) - aspm_calc_l1ss_info(link, &upreg, &dwreg); + aspm_calc_l1ss_info(link); /* Save default state */ link->aspm_default = link->aspm_enabled; -- 2.18.4