Skip to content

Commit 1a176b2

Browse files
Hans ZhangMani-Sadhasivam
authored andcommitted
PCI: cadence: Simplify J721e link status check
Replace explicit if-else condition with direct return statement in j721e_pcie_link_up(). This reduces code verbosity while maintaining the same logic for detecting PCIe link completion. Signed-off-by: Hans Zhang <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 0a9d6a3 commit 1a176b2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/pci/controller/cadence/pci-j721e.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ static bool j721e_pcie_link_up(struct cdns_pcie *cdns_pcie)
153153
u32 reg;
154154

155155
reg = j721e_pcie_user_readl(pcie, J721E_PCIE_USER_LINKSTATUS);
156-
reg &= LINK_STATUS;
157-
if (reg == LINK_UP_DL_COMPLETED)
158-
return true;
159-
160-
return false;
156+
return (reg & LINK_STATUS) == LINK_UP_DL_COMPLETED;
161157
}
162158

163159
static const struct cdns_pcie_ops j721e_pcie_ops = {

0 commit comments

Comments
 (0)