lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b363ab02-a2b4-9c5d-42ea-feb208d32c5d@linux.intel.com>
Date: Tue, 3 Jun 2025 12:11:04 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Hans Zhang <18255117159@....com>
cc: bhelgaas@...gle.com, kwilczynski@...nel.org, 
    manivannan.sadhasivam@...aro.org, jhp@...lessos.org, 
    daniel.stodden@...il.com, ajayagarwal@...gle.com, 
    linux-pci@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PCI/ASPM: Use boolean type for aspm_disabled and
 aspm_force

On Sat, 17 May 2025, Hans Zhang wrote:

> 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@....com>
> ---
>  drivers/pci/pcie/aspm.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index 29fcb0689a91..98b3022802b2 100644
> --- a/drivers/pci/pcie/aspm.c
> +++ b/drivers/pci/pcie/aspm.c
> @@ -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;
>  	}
>  }

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ