]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI/ASPM: Use boolean type for aspm_disabled and aspm_force
authorHans Zhang <18255117159@163.com>
Sat, 17 May 2025 15:49:39 +0000 (23:49 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 17 Jun 2025 22:31:43 +0000 (17:31 -0500)
The aspm_disabled and aspm_force variables are used as boolean flags.
Change their type from int to bool and update assignments to use
true/false instead of 1/0. This improves code clarity.

Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20250517154939.139237-1-18255117159@163.com
drivers/pci/pcie/aspm.c

index 29fcb0689a918f9cb123691e1680de5a1af2c115..98b3022802b232eb5cb35f4ebce2faaef3db60f8 100644 (file)
@@ -245,7 +245,7 @@ struct pcie_link_state {
        u32 clkpm_disable:1;            /* Clock PM disabled */
 };
 
-static int aspm_disabled, aspm_force;
+static bool aspm_disabled, aspm_force;
 static bool aspm_support_enabled = true;
 static DEFINE_MUTEX(aspm_lock);
 static LIST_HEAD(link_list);
@@ -1712,11 +1712,11 @@ static int __init pcie_aspm_disable(char *str)
 {
        if (!strcmp(str, "off")) {
                aspm_policy = POLICY_DEFAULT;
-               aspm_disabled = 1;
+               aspm_disabled = true;
                aspm_support_enabled = false;
                pr_info("PCIe ASPM is disabled\n");
        } else if (!strcmp(str, "force")) {
-               aspm_force = 1;
+               aspm_force = true;
                pr_info("PCIe ASPM is forcibly enabled\n");
        }
        return 1;
@@ -1734,7 +1734,7 @@ void pcie_no_aspm(void)
         */
        if (!aspm_force) {
                aspm_policy = POLICY_DEFAULT;
-               aspm_disabled = 1;
+               aspm_disabled = true;
        }
 }