Skip to content

Commit 64fd90e

Browse files
Hans Zhangbjorn-helgaas
authored andcommitted
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
1 parent c1842b9 commit 64fd90e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/pci/pcie/aspm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,10 +884,9 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
884884
/* Configure the ASPM L1 substates. Caller must disable L1 first. */
885885
static void pcie_config_aspm_l1ss(struct pcie_link_state *link, u32 state)
886886
{
887-
u32 val;
887+
u32 val = 0;
888888
struct pci_dev *child = link->downstream, *parent = link->pdev;
889889

890-
val = 0;
891890
if (state & PCIE_LINK_STATE_L1_1)
892891
val |= PCI_L1SS_CTL1_ASPM_L1_1;
893892
if (state & PCIE_LINK_STATE_L1_2)

0 commit comments

Comments
 (0)