Skip to content

Commit 010c310

Browse files
committed
Merge branch 'pci/aspm'
- Change aspm_disabled and aspm_force from int to bool (Hans Zhang) - Initialize val at declaration (Hans Zhang) * pci/aspm: PCI/ASPM: Consolidate variable declaration and initialization PCI/ASPM: Use boolean type for aspm_disabled and aspm_force
2 parents 2de2f92 + 64fd90e commit 010c310

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

drivers/pci/pcie/aspm.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ struct pcie_link_state {
245245
u32 clkpm_disable:1; /* Clock PM disabled */
246246
};
247247

248-
static int aspm_disabled, aspm_force;
248+
static bool aspm_disabled, aspm_force;
249249
static bool aspm_support_enabled = true;
250250
static DEFINE_MUTEX(aspm_lock);
251251
static LIST_HEAD(link_list);
@@ -884,10 +884,9 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
884884
/* Configure the ASPM L1 substates. Caller must disable L1 first. */
885885
static void pcie_config_aspm_l1ss(struct pcie_link_state *link, u32 state)
886886
{
887-
u32 val;
887+
u32 val = 0;
888888
struct pci_dev *child = link->downstream, *parent = link->pdev;
889889

890-
val = 0;
891890
if (state & PCIE_LINK_STATE_L1_1)
892891
val |= PCI_L1SS_CTL1_ASPM_L1_1;
893892
if (state & PCIE_LINK_STATE_L1_2)
@@ -1712,11 +1711,11 @@ static int __init pcie_aspm_disable(char *str)
17121711
{
17131712
if (!strcmp(str, "off")) {
17141713
aspm_policy = POLICY_DEFAULT;
1715-
aspm_disabled = 1;
1714+
aspm_disabled = true;
17161715
aspm_support_enabled = false;
17171716
pr_info("PCIe ASPM is disabled\n");
17181717
} else if (!strcmp(str, "force")) {
1719-
aspm_force = 1;
1718+
aspm_force = true;
17201719
pr_info("PCIe ASPM is forcibly enabled\n");
17211720
}
17221721
return 1;
@@ -1734,7 +1733,7 @@ void pcie_no_aspm(void)
17341733
*/
17351734
if (!aspm_force) {
17361735
aspm_policy = POLICY_DEFAULT;
1737-
aspm_disabled = 1;
1736+
aspm_disabled = true;
17381737
}
17391738
}
17401739

0 commit comments

Comments
 (0)