From patchwork Tue Apr 2 14:33:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13614206 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2095.outbound.protection.outlook.com [40.107.6.95]) (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 888EB13540A; Tue, 2 Apr 2024 14:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.95 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068487; cv=fail; b=RExJ1Ast4SY1VmdDJjvfZjbTOPR6zbeetNBB4ERiFTQbRz4yfEDGNO7wA6lnBshC2n7gMoZmIzNdyixxsqN4dNEUTydFZjiGiSdSnet6LdYARxrLv+n446Dy9fRFyicGQ/0UzeV4Gxktx0rdtlP8/1lv8B1e/wviwClrJyR2J2w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068487; c=relaxed/simple; bh=VF3tYmlcg/VMfEHxTbMiyjtGVpVYE79MrCZJlbIsON0=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ece0tBeaKt0t1HUaFj63/Uuxgjwh/axFgA80NnA702bY8V9DSifO71hNojZkb2cAOwqWBtejQpRPWmzUqbEHASsnqfIzm7tGTXRTYFaRFum46XQQTk9VVqJ8uwkhQZaFS0k5OxxHeeSwtV1x0yWkMiYJXFzXjuTLEzWGsvEZD54= 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=o5OEclIg; arc=fail smtp.client-ip=40.107.6.95 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="o5OEclIg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wu7ju5+/qxo5n5Ds35taPNAK61vpJNJEghKlw3sXBi3kryR79wIP1cHHX1Y2cPCFL+rhmkVpduccj+u0OE0ovqH1FhXMngaCQ8KMI4dFQeMEDn9Va+XPtSrOIDaWJCGeKUnfsXx9qLMS74COXWc2bbfeiKT6Ycv6/1x9O+7Ykwqr1zQR8OTqfSzPe8Y8+5UUBm74cUyvf4x0SSio6Lsngjb1AXRKxz5Buf7ZIuYrzt4iL9/rJC3WEPSn/m9f1r0grCSRlDsMwqYF1s5rfltlz/95fS5PASErbLVY+0RHnbTnXBK4E+Ax4o3e3gJDK2cFjZjAPiyjjskT8UAgpwWPng== 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=9Bxf/nwc+muySGSCfmby0y1/0mJ6Nd25suYBqOpzqHU=; b=XvCJNSLzZBRCvuBmRkN3qrACYTrf4iAPQlhUjUt29S0CleNIwlU4dojfxAg2RlsgI3YD9VJdpp/gABr7SDU/4+vdWdFVZed1r3rmOlDWfUpkOgHwQrFJGFZMMiRAjxLGaoKyzLshgfjSb2JNQK6472gRMTEaQUIcKenk4HcUyimnVd8W3Nolw5w86yrpp6RQZyAxldHDF1ySIr1UyCDmZExIfOKugaNZ6YZQRr6Q3543KHit/3vbiBzwwNRauVbc3jiqQVkQR9N5wB3QJwaJkNhVe9ViGHARD7x3bgL/AnYi9AjQe1axwtwTJUiloKqkJqSYR5zgy+lLo5MoTMNLOQ== 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=9Bxf/nwc+muySGSCfmby0y1/0mJ6Nd25suYBqOpzqHU=; b=o5OEclIg2rUUHA2QYPBQ3VUPr9kKqvoEkBn9qnzavUIjutjnq/grPsD+MZLshsjPDzOeHXtZNGi2NyX0zguH7x5CxXs2U4q6IX3iUr98QIVBtjxHEsw65cYmZE2GTdLvyfVyemFJze1JieW96N8Cl5exNUb588V3JI4giZKhsjA= Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8926.eurprd04.prod.outlook.com (2603:10a6:102:20d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 2 Apr 2024 14:34:43 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::3168:91:27c6:edf6]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::3168:91:27c6:edf6%3]) with mapi id 15.20.7409.042; Tue, 2 Apr 2024 14:34:43 +0000 From: Frank Li Date: Tue, 02 Apr 2024 10:33:45 -0400 Subject: [PATCH v3 09/11] PCI: imx: Consolidate redundant if-checks Message-Id: <20240402-pci2_upstream-v3-9-803414bdb430@nxp.com> References: <20240402-pci2_upstream-v3-0-803414bdb430@nxp.com> In-Reply-To: <20240402-pci2_upstream-v3-0-803414bdb430@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=1712068432; l=979; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=VF3tYmlcg/VMfEHxTbMiyjtGVpVYE79MrCZJlbIsON0=; b=+0bKMkodHyRByDaCR8zT9fPtUbvsDh2UwDSNyTGQwxuX0FXqj7KsnrL1WCuhvdkesKrk0php1 WC5Ua+HhfS8DHwGEw/dF2fnWyDeFZMfnh705gprCBcHkzVk/S0Y455z X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8926:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ojUg0/t81jPuRCIV88+8hB6bwozRIdwKCSod9e8C380dm+2LxhduxL4+sm2g7soBPYv/hpBx+dZvpjTqcx6gJJlGj4PE6npXIELq7+6TRMzTn1mrDMpFDTADh/8d6ui5lqkIQlUaxgK1yssGYZHYuKDelTL/3cNykUWj9+IzhpGzqfu0Jwy5/Ao9Qz+5bivfgMynGprIr/VI+ooicRE20UQd2R4Md9R+yic9AOqGwIxX/UkSyp/IWstjPuksan1Tzaw8tOXduSBJ/GPKkpI4zBf/u4L+/+P0FuITNbczz87O6nGQEoKgGLG3BYYtCHEsAv0nAmxEUG75Xkiv3Pe8/1Y/kwh7ummdd42JChRV/iTObwJqtHSnaKHMS931GoW+FpAezmfvNY+Qzk+9EAmP/SOV8GRUNu6Yorlsf4VEL224iQuvwSMwMQpGGVTk0PT5PuYMoveCXldrg/0KEI2rxZ8GmSBZc6RjPh74dU2PmjDVmfYX5l6ZjxFZfQU3EK6bCufNFEaI++4otJZsI+SjTqAZOekVzLbpv2q8tYjGrQwepWgXEIb+7/8CeGZj/I8NtzKHUehKjE/vmJo2jSRwLoEvjxTmct1zLAUY3zRDNGIsTxZnsgoH55uidCxgaPTB3ZCYF+1Yaj8/rXoX6LbZXTlbB+cGU+YoEf5tBNW2KvA4JLmYMr0Ln8JfyVFyhpMlLx5oTnIcws0CwbaUH60AGjxaGFXPV2CsgRkFJuc7Ed0= 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)(1800799015)(52116005)(7416005)(376005)(366007)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?N1CX/TVpMm8M0Bj0ZaRjSwuQJbhp?= =?utf-8?q?nV62Cy1v5lWkteuhyWseOI4iKkVfdCaxKr4lD88jhZPChRwcDKENHHR71B5ju9fnr?= =?utf-8?q?4eaTDWI6i3uMgKh823E5WmO6iV0aMqo4hjInA8a5IpSRVe1p8HdHyy5FEYjOW0pAD?= =?utf-8?q?+3YaMupaq/Y9tsdDMttlGip5457+movIINGPRfzr26Jq7XJM7ZF/TTekaUKxngm24?= =?utf-8?q?bWm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h127e5eu3/g5vnwXh5S0PinM72v6i2FhVku26l/57k4iSDiszAqOzL1X2KY4P2?= =?utf-8?q?h9lz77Itq+gIZ3xn+dz9OXILpAts/+e8Z5UKYDBG3uuDLH8YoWEpAL5Fr7juoNPMl?= =?utf-8?q?wQikhF3P4R5F2BB37stB0W28b0izVOKJsoEo7/LLZo/9GsUekV7MOIdcKdNTCneSa?= =?utf-8?q?hW/fRpYOHr/cqmFeKTu5PRnQVKSBP7sTcy1A0QzU5zWf7UuQ1FBetedPEfWy2SbZN?= =?utf-8?q?8si0q8rFBwc2XKbyVpQ0kCKFTso8+QkVKl4SQQcnO4IfD5AypNfIOA63fPczfKZMC?= =?utf-8?q?AbdC+eZRXm4iQlwVylwolP0AKyv2w/75hmC2SaRRWIFYme6P739Zr8LI23A97YgaH?= =?utf-8?q?k4qVKhLuslPZ5joVbER9PoJh1Ujpp/Ktjy+XQ9916RDtI6r6Opm3A3FU=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbbaf992-968d-4cef-7b04-08dc5322093d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 14:34:43.0988 (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: zSoQH5eIknRw/Mj7mtP8dJrRCJrj87YPDX5cVXQusBZ7Be4m0EYUjg3zlwn9Pvh9pD42FS9rDMAGlU9opIWiFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8926 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 } Signed-off-by: Frank Li Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-imx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-imx.c b/drivers/pci/controller/dwc/pcie-imx.c index 653d8e8ee1abc..378808262d16b 100644 --- a/drivers/pci/controller/dwc/pcie-imx.c +++ b/drivers/pci/controller/dwc/pcie-imx.c @@ -1103,9 +1103,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");