From patchwork Wed Feb 28 11:28:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13575248 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 6B7ECC5478C for ; Wed, 28 Feb 2024 11:29:23 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version: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=c8IsQI+dDI0ksTYFQ1xQgJyVVZ3UZYegWm+7z2d9IzU=; b=Qbe4Zr50tJSJem JBSDQZNpi1p7aPcU/HRWbmteoDgr1UOP7MZdEiNTj31YU2DLNJRd/gRjWROBFT+9y6RG3us5CDXon NUw1bUIFUCu6zXXZ4rqYXZbyAY5C+A3sl5cfysvexv41gcRnrhV9rV+DdRl7t1+PqPMRfc/hNgUdo YQyOaXwhAUp37S7zS8uAX5EUyNj8FAIZjYigJFcx1lIpCP10E5ipDlHwYOSR+wvDYs0nnHX1PkDZ9 yZ0Uf8tJb7npcxjPFpxvR4itnkbuQudJEepjY6u1w9VLvT6ucIM3FpciVQE37+XpyAmoDj/TToLtC N/gg8kGtYz7su1c07dlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfI7Z-00000008yvX-2tOh; Wed, 28 Feb 2024 11:29:09 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfI6l-00000008yQp-3Jhf for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2024 11:28:21 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9BDDD1BF219; Wed, 28 Feb 2024 11:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709119698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1seadG+CBBUxb4Y3ZLyFvvvNaIdZJZ6KheSJBHoIsiI=; b=ZOhb12jBzER1DD03jga9FIQRWU9oi87FiAFZy5Qqa0kq+mLmvvJq3PcAdOmHT4UdcUwmUX A8PYWegGZO+ozd9Co81YImFsFT3xGnyTGG7hfu5UW3DxnJzwqSYymQ4r2f737PQz2lk5Xe GlQZU9EFlqZ54mMlKmNr2hsQk1xSqmj+XIwvL4DrMIk0JTB6DIkEszA4rFdOmgafWVz1bZ B/c37Wv9VfLXucMS2ddj4qwkVg0pgHm45ctTiao9SSLbPBvC+eMvHzIwZyxLed/MMrapZ1 TZzq4lwFeJzGcf2PdZquUNK3hGX+RVp7Qpho9+vv51uZ6p0CZVK1r/9Bkvsibw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 28 Feb 2024 12:28:08 +0100 Subject: [PATCH v2 10/30] pinctrl: nomadik: minimise indentation in probe MIME-Version: 1.0 Message-Id: <20240228-mbly-gpio-v2-10-3ba757474006@bootlin.com> References: <20240228-mbly-gpio-v2-0-3ba757474006@bootlin.com> In-Reply-To: <20240228-mbly-gpio-v2-0-3ba757474006@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Thomas Bogendoerfer Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Gregory CLEMENT , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_032820_001842_F18A07BE X-CRM114-Status: GOOD ( 12.37 ) 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 nmk_pinctrl_probe() iterates over each GPIO block. Use an early conditional continue to skip to the next iteration rather than indent all the loop code block. Do not change code logic. The block is changed from: for (i = 0; i < NMK_MAX_BANKS; i++) { x = of_parse_phandle(...); if (x) { ... do work ... } } To: for (i = 0; i < NMK_MAX_BANKS; i++) { x = of_parse_phandle(...); if (!x) continue; ... do work ... } Signed-off-by: Théo Lebrun --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index c8d2699be985..69b421bea1f4 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -1203,17 +1203,16 @@ static int nmk_pinctrl_probe(struct platform_device *pdev) struct nmk_gpio_chip *nmk_chip; gpio_np = of_parse_phandle(np, "nomadik-gpio-chips", i); - if (gpio_np) { - dev_info(&pdev->dev, - "populate NMK GPIO %d \"%pOFn\"\n", - i, gpio_np); - nmk_chip = nmk_gpio_populate_chip(gpio_np, pdev); - if (IS_ERR(nmk_chip)) - dev_err(&pdev->dev, - "could not populate nmk chip struct " - "- continue anyway\n"); - of_node_put(gpio_np); - } + if (!gpio_np) + continue; + + dev_info(&pdev->dev, "populate NMK GPIO %d \"%pOFn\"\n", + i, gpio_np); + nmk_chip = nmk_gpio_populate_chip(gpio_np, pdev); + if (IS_ERR(nmk_chip)) + dev_err(&pdev->dev, + "could not populate nmk chip struct - continue anyway\n"); + of_node_put(gpio_np); } prcm_np = of_parse_phandle(np, "prcm", 0);