From patchwork Mon Jul 8 17:08:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13726900 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012025.outbound.protection.outlook.com [52.101.66.25]) (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 11B5714F9D2; Mon, 8 Jul 2024 17:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720458547; cv=fail; b=uTyH25yyOlOWQIO4Ld4Ti1DMqp0RjcW4+5H9ds9hhYeHoQDtZSuRHNcbG8EcuaIPdhqFaq+0yHAwrQmYB9tyVOT0t0cVyVkgMZIT2WXYnD9VZb/GQSLHuR2ZmrWUeRPwFFBpiRJuf4UNUu2Eq7vEtTq4TSaoMkdYI+5rmrL0Kkg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720458547; c=relaxed/simple; bh=ymgQePC8ggoQS45hlSTw4V4RvYj1NT17SRqn0qqc2PQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=AftitpyJhpGCTsBCNplhEC3Kzv5qmIqdw/tdNq8CkQ8ZJ22HwAMZ0Cb49OI4FP/lkRwYKiHcrWfcyL3UZc8i/RnWVGUISgDzQ88GA4srkJnB6zG9tPpG0+McAkWOPd0HW1sZINRY1yCmwazT+iULGkXKTRi3m18H0m6M6D1AYdg= 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=lO3JO/2F; arc=fail smtp.client-ip=52.101.66.25 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="lO3JO/2F" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=erehdGw4IKWGXTI/s6WNMEQBDpAZNf9ttRBxru9kRNvZIhRs0veSGGNGQywUxJYFCgaqoCvqRQsB8c/J2nUT4jZi6qo2EVpdy4j2Q22PiCe6DE7ACQzY8WRBpfi9BVcUG6C7i7826Ap9iSSPa7p23/mc2ABaQrD4UC9B5PzgPpUNVGSSAtVxUKTyS5pgP7Gjpmx1aGBOC1CWWMgZxHgvfdMCfLDR1PGwgg0Wzz9wVGEEriCWTKCyt4TsCrLabCbXbleOtkPZnLFio/98rQRfKavOZfQvmDrJWwsR+UiIIdW5Hx+2JQkbUxgJLwHADCkBudxEMoc3/YUNeFXf/u2emw== 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=BiphaEwuqok6wvOgOrxuwycBZ+89P2+4NMqys0e/yxY=; b=FHK496Tzh5WyYEISDyGDnnQmaplLlvvITq8n2Ud28YGybGhIgUo7S1woc91eCrXuX983L7aHQbwiZLawMZIiN1FzizkgLiYeNO3/23pwnAXQuHGa3xS0SRhciKy6qgtp74++0An5Yon+NcvISabvsYRXNFfYdrCTwCz8uOJCxCSyWi97yU0jGPX/hhCX1MVsuN7YCcQsaw44aWTFIIyJBgynYv4WDJSm6+Is5yKhVgTK5jfomSpOBx5YC8cUwalAMCiLzlcTpQAg3P5BHYz2OnHhnm0sqUuKi32Z0J5r7ejqssa/8nlH8xuFMtMSOaYbsZs7K8NG78tyt7iAcTXWqQ== 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=BiphaEwuqok6wvOgOrxuwycBZ+89P2+4NMqys0e/yxY=; b=lO3JO/2FI92jZqc/1lnZ/42KpEApJrmtzomEH4EFvyKNMTuUU5IBcESgPKUcpjmrR9ylhNZ+vGkbJHd/xsutoYwPv4kW5e+3f/So3BcmFog4YQSUhFeo8SkywhSEt0dBI0sGGN3sAQprHD1v0dPPchXu2RpgRpV+yhUQIyNK79M= 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 DBBPR04MB7867.eurprd04.prod.outlook.com (2603:10a6:10:1e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 17:09:02 +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.7741.033; Mon, 8 Jul 2024 17:09:02 +0000 From: Frank Li Date: Mon, 08 Jul 2024 13:08:11 -0400 Subject: [PATCH v7 07/10] PCI: imx6: Consolidate redundant if-checks Message-Id: <20240708-pci2_upstream-v7-7-ac00b8174f89@nxp.com> References: <20240708-pci2_upstream-v7-0-ac00b8174f89@nxp.com> In-Reply-To: <20240708-pci2_upstream-v7-0-ac00b8174f89@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=1720458497; l=1048; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=ymgQePC8ggoQS45hlSTw4V4RvYj1NT17SRqn0qqc2PQ=; b=TrM60Y7asVn1m4bt/Xnl+3qy4a/0HjqwFx5F5fyYSyQB5yOXguHQnz0zfqO0GOOKY7orOuR55 NwnqJE3fh5qCW72KT0b+KHDTgiNFiUkOVmaD7bzFRNBIm6UKodrpNDu X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0198.namprd13.prod.outlook.com (2603:10b6:a03:2c3::23) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DBBPR04MB7867:EE_ X-MS-Office365-Filtering-Correlation-Id: 62e4727e-61ad-4124-0a60-08dc9f70aa69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|7416014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?cIvoc6NCgKMxQD2WzCvmOqk79Eh5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Up?= =?utf-8?q?L9tGENtHGFTt13Crz3CQqrEIq3ghzcRcxXClAg2pHUsuO58Xf3YGgPRe7giY0Ud7U?= =?utf-8?q?DdeE/GLtc4sgWhG2E5bGCcXzx/1aSilvk8r39F8vxnq92gFm9ACZ2a5Q79VjrNobQ?= =?utf-8?q?52ixHd73epFom9zAMO4HP/qVrCAYbVOrNbe+NyFm+f38kbs2F+SJyBcHt2fbXIoqY?= =?utf-8?q?sU+fsccuqDp9GGp4poVJXmdzyFh46lDbAgseiS7nu9hBO5s2oEOmt2l2mAxplm0II?= =?utf-8?q?me3BkIiDg3pb/ABnCLshwUyL3FOv/aphT9TDs9YnNL/11QhcNjZaMWW0boVe4tpKS?= =?utf-8?q?pIBbvj4azXTKm1tKWNajE8kKKps7gcQ66Jo/C8JiGcAY8bnxlEWzoNfZpA5Ho/YR5?= =?utf-8?q?oizSlGDWiT0osTxrazYiO3jxPjCJ3sa98VeU157XLchETBTPW31AC+2HSZaESOp65?= =?utf-8?q?LbuXxFJf2Iel2UBu2PN4Jgk7vyzuucHsF51La5KflYMnmE4y0OTxw2s=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:(13230040)(366016)(376014)(52116014)(7416014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?4yzS4PFq7ME7qtJT7xLe3lMcRBom?= =?utf-8?q?sk+P8VKjJZvRYH8isMgNFiMUK7ci+mJ3XD1wOoWM1jlpWaYwuM29MyPP7wnIXOdaP?= =?utf-8?q?3pwmCuckA2O6bzXxWUgOK7Bji8rL5QS7v48hphthBfrjCKa+vXWwKFOWvGcNe7JIg?= =?utf-8?q?/db5OkrtV+u2e9M8CfsxNPpgKuH0N9XXL6FItUgE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sPaPvWZoG5L+98Vn9s?= =?utf-8?q?fn5SNJ3njCVKpNJsT6+uY2Q2y51Rf75Sd0kh8E5pbW+BaL91LnZ3XgTp2QW1e5fNK?= =?utf-8?q?Zo7RifwjNRL/AQi4dUfB8u7opeE7wS3bGR5XpXL3iZor7gUwOW7O9MKnYLYspzOWW?= =?utf-8?q?rdO5WRSb06FnpVFy1m0rgeGbz5p2OWRlRxT2eAvpmD8muAGDLtf+9H6GQah26Aljx?= =?utf-8?q?i25eigw6fgrfKPB+5i1/CESclbO5W+jZt5Zi/QWs3bdFJ9F4E0dsM7KDNvlGallH9?= =?utf-8?q?1AS2EK3TSwcayevpZqSeMIS9OhSjQnrAuqp1kSUMNC8VTCJh5PZRCsEfkVeaVy3Ir?= =?utf-8?q?ZhDwm2BD19+e+fiC3kJLl+/Nmmeti1Bogs4YFHP5pGvxJuiuH9BrCjZDVvufUdVXj?= =?utf-8?q?oK4MlXJ1eTg1Tkvux+5IDBxeCofxtfnbax5Q/HxJfD5hWROFQQe9uDIY=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62e4727e-61ad-4124-0a60-08dc9f70aa69 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 17:09:02.5174 (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: K3U9wz387UdSi9kqiFm431Vl7wBygjX+UEn66Uv/hE5Kog+aVUXfgYKMrZatJSHi0zqlsIl5MtCZJ7i8YLIxzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7867 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 2b95c41f8907e..57814a0cfab8c 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -954,9 +954,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");