From patchwork Tue May 7 18:45:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13657601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8562EC10F1A for ; Tue, 7 May 2024 18:47:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=IM6Ys5vKtdCQ6Ou85N2XoM2M08+DaSkAMj9waPWdU2g=; b=Z9oCfzP3FIoTUQy8VWkMbZlu39 lDdjRkfJrBmLSqLrEWiqPcLi7KQ8rNBbxRgeOMA4w3lPwqLrFDYJQfX9l0ptrend2iuYF8g+QZ2Y7 ethESuc6wL4W2+Q4bv5/GEIKePJ4YL0MbC94zkfmJHUQfqYA1O0APZC88pvOCHq2Vlpkc4yXSgYus /cxuc0eEThd8lUeWjnSxrhAq71Or0zg8si6voZlVJgSlGIQ6oYZ6vbi4Qwp+bG7XvLh3iZ2tEvDzy +fOdD7uvzLymXYLdvUrsXsfv7mh8IIeifcGS9NeNHUUmldgQWTBtEQcRMe3Vi8cEc0vvytpRiGsfT mAJb1SEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Pqf-0000000CQ7R-2OZX; Tue, 07 May 2024 18:47:33 +0000 Received: from mail-he1eur01on0626.outbound.protection.outlook.com ([2a01:111:f400:fe1e::626] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4PqQ-0000000CPkC-1xtc for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 18:47:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXpKnvREYuj7Y72Xc3NUtLx9JXn19fwMT1UQ2LcIHxnnzDZZoGGNLNyKYZBdgnofKeKWS0tqp621LfeMVy2ZBAE+Xke3ieDvv3P+WQmvuw78fyWiri5vZ4XcOMLS2cP5UTa5MUgz90wtAvdEaRygqIafHmbds53lYyJ491yHyf0YSdJ4+mtCC9Aajp0vPQBpexO1+ZoVQcK97VQkAR1eWle8BpvEJS6GG+gH0HXA/XD16oZam416EQgscVEA5+4bzJJB0KSM37zMPHaOOdjV4BtuSaYSr36KYhBgQPlzV7tOIxkAOyhYND2aTb4yA0x7ukoG1ULcwLkwvxytllIngA== 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=IJ8+34n6tB2srgggrSYc9JS7VpTWsMEFMzObdI2BDY4=; b=j2kGg+bhM42UI4jsKC4w+X9TS+jPOuND2TIWXAZVIEhK34X/vCuIuxLUMAmJRgw+hgTruC5mpBXjXoZHxZa1zwuPY1T52WMXCgIVR+m29UUOeNfohwoWEMIfGsmKRpjmQCyV/bbHwaQFDl6CZfvMAWwrX15md4h4CTXBpuf8ayIkomMuVpOlakhXWtTT8taYzQ44nsGx8lLijfuehLFCKUpvGsup08B/6tQ1KY70uHr4ymP2Ik4t2zn3fKOXvZnTUkFiE+6HXARSROG5RpuPnpAfRNMPAPmS8K/0gYuemh4hkdOaMA/NSsEAfIWdcK6MwLwd8//Bi8DYWjgyIvM6+g== 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=IJ8+34n6tB2srgggrSYc9JS7VpTWsMEFMzObdI2BDY4=; b=GGSHFOI+41Fg8phLddLCnSE12xkidgN1GUVFW4VWlrjLuTN6QU1Lig/A6TEZoQohNKLs8Eeiaqjy/Vz3QgXxTfzQm5AvMHhecCp/j5FJazoY/VU9lw8dd7wYOUGiAU7PxfHb9gGq7tOesTY6JJPJpyj/4SpaYRG3e5JEhQs50Mo= 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 DU0PR04MB9636.eurprd04.prod.outlook.com (2603:10a6:10:320::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Tue, 7 May 2024 18:47:11 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58%7]) with mapi id 15.20.7544.041; Tue, 7 May 2024 18:47:11 +0000 From: Frank Li Date: Tue, 07 May 2024 14:45:47 -0400 Subject: [PATCH v4 09/12] PCI: imx6: Consolidate redundant if-checks Message-Id: <20240507-pci2_upstream-v4-9-e8c80d874057@nxp.com> References: <20240507-pci2_upstream-v4-0-e8c80d874057@nxp.com> In-Reply-To: <20240507-pci2_upstream-v4-0-e8c80d874057@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=1715107574; l=1050; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=uRbYV+8P6VjCoxmSQ3mxj6dE+Tuv3Whv1pWoX9EvqFU=; b=3MmPWG8waR7Qnxd0N8fgyHKND+oBRxlIJRVKYtKS5OrYj7pKzRCJ52p106JvTjOIql/eVVDx6 AvFjIssgrH3B9nSVsgDfpFHU5zj2Jdn0SILSp7uOAnm3aRSS6xeIY+n X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY5PR17CA0026.namprd17.prod.outlook.com (2603:10b6:a03:1b8::39) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9636:EE_ X-MS-Office365-Filtering-Correlation-Id: e11fba36-25a4-4ffd-2581-08dc6ec61a8e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|7416005|52116005|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?DQ+Q/l0JiehnF2ABw5atm2G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SW5vluXNHcC?= =?utf-8?q?yyfJ4ILgGztCWJvNGxak4Ux53FhiHQF9A5FIGmJc0ftFlbTqrpP6hk3Mxg5OG7axC?= =?utf-8?q?5ixv8MhudGC6b24BKph7QOlP8STOvkkBwXIg4To/rEXvbnO4uVS08+7tgUIk8lU36?= =?utf-8?q?B6p+XECLADtJxnYID2KUQfKPU4WOo4gbBiT6eRWw+bp2h4TViwIt3dXZvuj5CZ6Vm?= =?utf-8?q?F44bXoWA60Ap4c+lBxNN1CQDQV5JGWKUX/vPNy5ZqV+dwBmOUrdlCH7pNikDX2WEM?= =?utf-8?q?42jx0yZSXRNzScIlE52J/Uxo5s6OSjp3v8wXuSpEFnMMPUF4Bop6qIQluNT7PbyjK?= =?utf-8?q?a5k7Shr4QjWDPkSsGjSVxShBLogSYtGGO3cCAsrdKgdq+Y5R/3lnJsw2fknEmXDwB?= =?utf-8?q?oRhfyIgLnOTP3vJtXrR5FvcWvBSzxke/E+AXgSq/ILjzz0SXabmCh7DA=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)(1800799015)(376005)(7416005)(52116005)(366007)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qmRw+0gJENd6Iu6CwNhye4dyY3eD?= =?utf-8?q?4Qm7G9c/7rqyTjM+TuGk8b+I9VpwcaAQsv6+TuF8gzqCBtoMhSDmgiIpdlDGx7Rih?= =?utf-8?q?ckb4tDPoM0HTm8hxJRxqSOGR6PMBiblSrP7nPSpiF5B2cIMUXAm8hIzPYwFyx00wn?= =?utf-8?q?baK+D//8QlUDfcpPikJD/Evt6tGc+QPthnv7S93TCrJE+AFpne5Y3hRqgCLlBKzeQ?= =?utf-8?q?5Xw76ZYsFTG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i+2ZH7Cc3HGF4wYOPPeWSggtlm9nzpYJsq/0z?= =?utf-8?q?51H6E5Jc3NZkRrJMkFEdws0swy2JRTEdIBYvT+mKM1D79rknzQBN11cyoRC9zCVNw?= =?utf-8?q?2ZQq474Togwf85P4dVtY8fjWzRqXNCk5W3mvbrH/LB1oPGprTPDcWfubEgBHWw4zb?= =?utf-8?q?WC+T8JorOCl0ed9wHDHWVNdtw/2YxkmTlB+uH6OsgE+fj/HmlKYRqKTcB1G45DLXK?= =?utf-8?q?Kx/+n4N3cqJyMx5YsgyjTFWNkxWXSEHLrWpuMahHiCaVWGPftAKT2NA9oJ7NhUDIn?= =?utf-8?q?KA2Wr6cq7/guUd049ijnZOI/Yhs7NUS74fcnWq84ZuhNDT597jnKODfw4kNvkV/zv?= =?utf-8?q?VFJRv2wASbsbiuBPzo50ILvJq/Yxx7Kef7kOzbZb0xM6zx4ZT8C+ryMwUkVti8cvs?= =?utf-8?q?vxons0e6k8U8?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e11fba36-25a4-4ffd-2581-08dc6ec61a8e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 18:47:11.1642 (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: ouo/zVVN/tohMTENLt1VHAQkdQu0AsDS+fddF3hkweZvusMCxqI4Pqj9kS6zMGMAeluNFQU9+EvayFDzlFEbIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9636 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_114719_133696_04FE0BF2 X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 66573ef7a002b..9d53b545540c6 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1033,9 +1033,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");