aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Zhang <18255117159@163.com>2025-05-23 00:15:33 +0800
committerBjorn Helgaas <bhelgaas@google.com>2025-06-17 17:31:54 -0500
commit64fd90ef25206b1b9f232fb192ceadb814e991a4 (patch)
tree2efe16f984ec6569ea75d03bcc83586874c04c6e
parentPCI/ASPM: Use boolean type for aspm_disabled and aspm_force (diff)
downloadlinux-64fd90ef25206b1b9f232fb192ceadb814e991a4.tar.gz
linux-64fd90ef25206b1b9f232fb192ceadb814e991a4.zip
PCI/ASPM: Consolidate variable declaration and initialization
Merge the declaration and initialization of 'val' into a single statement for clarity. This eliminates a redundant assignment operation and improves code readability while maintaining the same functionality. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20250522161533.394689-1-18255117159@163.com
-rw-r--r--drivers/pci/pcie/aspm.c3
1 files changed, 1 insertions, 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)