[PATCH] PCI/ASPM: consolidate variable declaration and initialization

Hans Zhang posted 1 patch 11 months ago
drivers/pci/pcie/aspm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] PCI/ASPM: consolidate variable declaration and initialization
Posted by Hans Zhang 11 months ago
Merge the declaration and initialization of val into a single statement
for clarity. This eliminates a redundant assignmentoperation and improves
code readability while maintaining the same functionality.

Signed-off-by: Hans Zhang <18255117159@163.com>
---
 drivers/pci/pcie/aspm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 98b3022802b2..919a05b97647 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -884,10 +884,9 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
 /* Configure the ASPM L1 substates. Caller must disable L1 first. */
 static void pcie_config_aspm_l1ss(struct pcie_link_state *link, u32 state)
 {
-	u32 val;
+	u32 val = 0;
 	struct pci_dev *child = link->downstream, *parent = link->pdev;
 
-	val = 0;
 	if (state & PCIE_LINK_STATE_L1_1)
 		val |= PCI_L1SS_CTL1_ASPM_L1_1;
 	if (state & PCIE_LINK_STATE_L1_2)
-- 
2.25.1
Re: [PATCH] PCI/ASPM: consolidate variable declaration and initialization
Posted by Manivannan Sadhasivam 10 months, 1 week ago
On Fri, 23 May 2025 00:15:33 +0800, Hans Zhang wrote:
> Merge the declaration and initialization of val into a single statement
> for clarity. This eliminates a redundant assignmentoperation and improves
> code readability while maintaining the same functionality.
> 
> 

Applied, thanks!

[1/1] PCI/ASPM: consolidate variable declaration and initialization
      commit: f58089683f6fb127ed87a5fcf78087de76c9d178

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