linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/ASPM: Use boolean type for aspm_disabled and aspm_force
@ 2025-05-17 15:49 Hans Zhang
  2025-06-03  9:11 ` Ilpo Järvinen
  2025-06-13  8:48 ` Manivannan Sadhasivam
  0 siblings, 2 replies; 3+ messages in thread
From: Hans Zhang @ 2025-05-17 15:49 UTC (permalink / raw)
  To: bhelgaas, kwilczynski, manivannan.sadhasivam
  Cc: ilpo.jarvinen, jhp, daniel.stodden, ajayagarwal, linux-pci,
	linux-kernel, Hans Zhang

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>
---
 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;
 	}
 }
 

base-commit: fee3e843b309444f48157e2188efa6818bae85cf
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI/ASPM: Use boolean type for aspm_disabled and aspm_force
  2025-05-17 15:49 [PATCH] PCI/ASPM: Use boolean type for aspm_disabled and aspm_force Hans Zhang
@ 2025-06-03  9:11 ` Ilpo Järvinen
  2025-06-13  8:48 ` Manivannan Sadhasivam
  1 sibling, 0 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2025-06-03  9:11 UTC (permalink / raw)
  To: Hans Zhang
  Cc: bhelgaas, kwilczynski, manivannan.sadhasivam, jhp, daniel.stodden,
	ajayagarwal, linux-pci, LKML

[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]

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@163.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@linux.intel.com>

-- 
 i.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI/ASPM: Use boolean type for aspm_disabled and aspm_force
  2025-05-17 15:49 [PATCH] PCI/ASPM: Use boolean type for aspm_disabled and aspm_force Hans Zhang
  2025-06-03  9:11 ` Ilpo Järvinen
@ 2025-06-13  8:48 ` Manivannan Sadhasivam
  1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2025-06-13  8:48 UTC (permalink / raw)
  To: bhelgaas, kwilczynski, Manivannan Sadhasivam, Hans Zhang
  Cc: ilpo.jarvinen, jhp, daniel.stodden, ajayagarwal, linux-pci,
	linux-kernel


On Sat, 17 May 2025 23:49:39 +0800, 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.
> 
> 

Applied, thanks!

[1/1] PCI/ASPM: Use boolean type for aspm_disabled and aspm_force
      commit: 7a04f18b95bdefdc8d976ccc8a4c0443b460039a

Best regards,
-- 
Manivannan Sadhasivam <mani@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-13  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-17 15:49 [PATCH] PCI/ASPM: Use boolean type for aspm_disabled and aspm_force Hans Zhang
2025-06-03  9:11 ` Ilpo Järvinen
2025-06-13  8:48 ` Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).