From patchwork Tue May 28 19:39:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13677266 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2077.outbound.protection.outlook.com [40.107.21.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5197117F361 for ; Tue, 28 May 2024 19:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716925223; cv=fail; b=o7coWI3YyyajEW6vByR5OIOiwCHoZt6Y70g96eRBIXolqLMlI/276LkcIU0YadsZxqW0gV/gZlQT2i/H+yfqGuA3TCc1gStP7+SWT/D0XPtqB1jWjgP/Z2pAAbEqkrSzTPdr/jdp84okES4IIJbsAm1pqsGoGuMJBpX0jdNQXDk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716925223; c=relaxed/simple; bh=ySu5qHk7hIAcbcfDqEd059/E1Yj5995nHxkvFfStadc=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=hCBVM/P9nI3mqA51HXMAbhahSU936T4YBlT7WBMTPhy5wLh4cGIcTU5iH1zzGSWzF8Y8c7swcNd68gWfluTDtvFYUNvcP4XC4xIuBFlgGzTddupc6G38TJleyenhWngBtCY8KtoyONzhLHh7fORwXqRWFdxiZE2owByaCShi0YM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=B7iZDjEV; arc=fail smtp.client-ip=40.107.21.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="B7iZDjEV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZV92XfYtOBeaA/YefcwVJk8KxJMRA6i3zK+HuqSNhZotoVaT9a0dihFDBrp/Qx/E99vksrZZd6ssi39DMlFfLgDc5CQZV01Hx3AzSKwCNZWVYYWt0VN+nHtQRX+UWJEWgHxYyx3AoLm8RwNzaIUQjUItSNucXno+0voAYDRDv+06qfbC4DmDaLCTDSEXpBbq/59tMQxeRhhO32Z+JGEUPVuVXytkOrZGnQgbwgtG8UZKaV4duB4Fpq23R0T40bMStrZyVrxwWEaL3OO0gQpV+X4CF8DlJgTzzW+KDyv00yg/zUo5aLAN3TISYDzthoJHojZ4GaoQQh9lfZ2cKmU6xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XDJN2Q663bcenqdW6HOaSCyJ1hJBvHmMI8fJTReImEw=; b=VOdsGVKwBmkqJV6gaLJ3aRKCObIzKTPJnLir0/IkqlkMv5v+TArV/NXGKeyzmWVTrrG7gd86bwILS8QqsfqnjjcjYMhHgdWUF4/KF2gDZ0axpZ2W5tFUuUwTtlmofY8LbJYK2+B5D5gDuIRrXbqPJyWNfHks8UiN3fFsSDiOoknFwbYP3WZ5+LJ+XyQ5Pf5jVbXCADt9caAONVGK4Aw35wckIO06KyxMbS2OFEqF7tdfFXaASBbEu2xstCutv+ZpkrGiUR+KEnBfWQXusXKe69yRuU5HQEuuYtKM8RynvlHBaCwBbKouXFbjCjowDcAfkkgnrRIw6OVKEDergi0vPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XDJN2Q663bcenqdW6HOaSCyJ1hJBvHmMI8fJTReImEw=; b=B7iZDjEViSwHavdsyg0nWo9g6jPYk7SSRCAQx6lAIHUBXay8QNt+8K+4Px+QWbSHcz0tPhVoHkMkCuQj3kEquJAmTPF7TqlEKcdmyyvm5Sg1Z+0wGSqGKPRE/uE7KyiECAmoTBYw1L4n/9VQHxC9wCUP0gluBNmh7IXn2AgYxPk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8655.eurprd04.prod.outlook.com (2603:10a6:102:21e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 19:40:18 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.7611.016; Tue, 28 May 2024 19:40:18 +0000 From: Frank Li Date: Tue, 28 May 2024 15:39:22 -0400 Subject: [PATCH v5 09/12] PCI: imx6: Consolidate redundant if-checks Message-Id: <20240528-pci2_upstream-v5-9-750aa7edb8e2@nxp.com> References: <20240528-pci2_upstream-v5-0-750aa7edb8e2@nxp.com> In-Reply-To: <20240528-pci2_upstream-v5-0-750aa7edb8e2@nxp.com> To: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Philipp Zabel , Liam Girdwood , Mark Brown , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley Cc: linux-pci@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, devicetree@vger.kernel.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1716925161; l=1050; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=ySu5qHk7hIAcbcfDqEd059/E1Yj5995nHxkvFfStadc=; b=UWIOyHZBdzRyNAfFu912U7je8+f0OrDQMMthCa8FHcdVVr4G87i2v3rjnhQ2F/eYANJTvpcLz wE60yGwuD7wD3IWM9KgFNJNszwn7cGyViVkiUO1/x04n+I+gPqbyJg0 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR05CA0021.namprd05.prod.outlook.com (2603:10b6:a03:c0::34) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8655:EE_ X-MS-Office365-Filtering-Correlation-Id: cb5457b6-c835-45be-3058-08dc7f4e0125 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|52116005|7416005|1800799015|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?AThAnTqx+RCWhUPMh9XOdByiY1uTgoa?= =?utf-8?q?pQ4/QheM2xU+wH3tBULqRqlC/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NWZz4w3b21iX2PcNDY1vGY8czPcesS?= =?utf-8?q?vL9qtPC2xg/4+htJ7zZUY/uVoV7AtynKT04wZbsQwJ9b9WZ9F+5HPeMtSja2ArYyt?= =?utf-8?q?tni8I8tc3cklnL8qWEVnLoIsTB/cRWZqrl+CV2/WXnK3PhcX/jXfS/r2LNV4k7WRG?= =?utf-8?q?jyFR6fhIQBy7JOKj0reYsuNkH75mPuxF+DrlHhu+0MvRTmQJUJI8bpOl03S+J7DuY?= =?utf-8?q?vYNuszFZlVgNvrgBKwda2bSEU2acDcVnSAnq7ltTHNLn/J2cPeMQfe6SEnnjaCLfM?= =?utf-8?q?RJ8G2NxXKn9JPLI3y7DKh11sthennwYPxhu4P1WcTPkEzz+OehIuiJoZfKR0FENhY?= =?utf-8?q?ch/w0hO80kGrQwY6cOIgg+5Cmk1Jq4NB1aBtT6T4AMg4SFdf0gpAuvQc=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(52116005)(7416005)(1800799015)(366007)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?A5tFnfk6euhjpTzQBGSNIuUCsuuR?= =?utf-8?q?2Xl21n0aykRFdhJSWCrChy0jPQMFsoBvp3M93equ5o/Rd3lINTuPZQa8CVqq56LdF?= =?utf-8?q?jMSwaVIJjTRXyLvDEG5s1RwXTRttSdnbWQ88diDMv79wK+dehNv/n6mZNuncPn+T5?= =?utf-8?q?9qQA2+uI1fDMSwnOFkYhFHR7Bi7oVVCddImBn/6xSW4K4BxJMJF95kO20OqyeqzH3?= =?utf-8?q?dI1OJcUWQZnrw+1Yct/kLkxLH/ot79p3vPrxE4SpMivTeha/GUEiZ0iIlXSDiupZK?= =?utf-8?q?y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GYwnAAMmIdS+hWzSjKbJC2hZyp/564Oczvug2QS?= =?utf-8?q?+n0VXwisIPHsVtdYqFvo9coNH5ptjQ3wTBvfPt614DEk/8OX4cg9QHC4rEUaTABEw?= =?utf-8?q?BnHE+GFrKOhjb4chemyskvJUVL8YqsV7FWZTjhTdQwg7KqZ/zLPmZzrWITK7+eZEn?= =?utf-8?q?d5+Q+XnbT/0SbnEtIQSgs/vf36VP1LuEg40//IKN3Px9PjLCTRpWzZCr2ECYfggpU?= =?utf-8?q?F7TlWIVu2QxMatu5C6iKBynaZi2smiGkuqqCRNC6eSeoIt1jwP2ZySVx/LONF11Z3?= =?utf-8?q?wH9FBKELYxoFqfHmtSDTQ3zB8Bo65XApHeIjcil9xHnIhfQoXxUYX3os=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb5457b6-c835-45be-3058-08dc7f4e0125 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 19:40:18.4119 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Nl3j9YI2d3JMiSMGcctTRcpAvHfJKMx7lPQS74zq3+4dba+5baTuVGPSc6ooGgAXw7yCtMZW29pOqcxcBmv6Uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8655 Consolidated redundant if-checks pertaining to imx_pcie->phy. Instead of two separate checks, merged them into one to improve code readability. if (imx_pcie->phy) { ... code 1 } if (imx_pcie->phy) { ... code 2 } Merge into one if block. if (imx_pcie->phy) { ... code 1 ... code 2 } Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pci-imx6.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 8ecc00049e20b..c8d58481f80dc 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1028,9 +1028,7 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp) dev_err(dev, "pcie PHY power up failed\n"); goto err_clk_disable; } - } - if (imx_pcie->phy) { ret = phy_power_on(imx_pcie->phy); if (ret) { dev_err(dev, "waiting for PHY ready timeout!\n");