Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp848796rdh; Thu, 23 Nov 2023 22:16:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGNmbjuKd+9h28YpT5G2ZxF0itK+EsTY+2vaLdnG6Og8KKQhFET638Dc8SNIuot4Zcjsk1 X-Received: by 2002:a05:6e02:1c0d:b0:359:3d9a:2837 with SMTP id l13-20020a056e021c0d00b003593d9a2837mr2485667ilh.2.1700806587666; Thu, 23 Nov 2023 22:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700806587; cv=none; d=google.com; s=arc-20160816; b=GIbP0DS8BRb122Q1nktjCcyG6xVTEhn67XxTOs4XH5ypABgoPVwZvuzx/Cxm9QYc5F r13Qkhb0chsZGzWFiNjnf7L3k94ys7xl5/61W9dyMXvNNtMF3HGKo+u8sa7QoK2UcPqG 9t48/x4FnHXG1tXHgU1TETjGsSVPaolDpN6cHA/vlI1hBFjkTinABHoYaDEc1GrMYojg Yax/rPpYgTx/LHrImD3ZNyVN9EuXlNr35DsAbR6AzQl3SndiIbb9TBTk8WAqPNdf7gDn Z3Qb4NriHuaORcsQZzIyGwi7kY/Bs0w+aWbM5h39nI+Bo4YD+Pe2DcdW8Q2JPgVpvwvN 45DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2en4yv4YpXFN3VCi3B3SISp0lZy/QFymnnSLRtY+3pY=; fh=UtlQhRhLKpbK48fI8aAhq1bqi4+bdxjfHDYQgAa0jjg=; b=au9H4320RGQROV2242NFGkmz3+vEFq+xKYVhdpG2YLxSw9NM1WH4PpWJEQVO1ZTPO+ P/Ar6kwi8/WjJ7fRN3XElbI2Bh+w+0qR5j8Y2qQyqqRvKjlrWgvO2mDx6J9n40f0l7CD kTJpcQiYMwJjC1wiyoq7jNzG/B5HnKCNM6nwXZHW+NynUZmC60p/+sWYrRjbLmXfeCk0 Y7sTIh0W3x1KkcRcxMXSHtmjuDN98YKqu1kL4XRj8fbLPOMiKPfy3kz7aQvTVOewlVhe ywMfTkXgPjmOtJKT6dpaZSwPLLzTuWMz56EIsSisS9NzbvSmP782gSMDHaIygrf4eE0A JxzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=QTf9lhew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e26-20020aa7981a000000b0068fb1a85ec8si2736016pfl.370.2023.11.23.22.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 22:16:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=QTf9lhew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9410680A9193; Sun, 19 Nov 2023 23:01:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231985AbjKTHBb (ORCPT + 99 others); Mon, 20 Nov 2023 02:01:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232043AbjKTHBU (ORCPT ); Mon, 20 Nov 2023 02:01:20 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01FC8D70 for ; Sun, 19 Nov 2023 23:01:12 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5079f6efd64so5148182e87.2 for ; Sun, 19 Nov 2023 23:01:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1700463671; x=1701068471; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2en4yv4YpXFN3VCi3B3SISp0lZy/QFymnnSLRtY+3pY=; b=QTf9lhewJfbzft3XCWSxCFS1TXo0hw638GArgBf5I6Ts0Jc7CBcZlhMPEVQBugIwA4 SqtYXkjyRQ6bbObhwze5jmBhGRtyD9p0MnzcFwazTKLKD2it6H/PWDXuhdEvpMlBQ4C0 nui32BEWxaDLa2B6G7eIQAnSZjKwNqWUsxQ+a4J5qWMjQ07gHbOArTTQxX/sEYeF1j5J SWaJ00pfZyJv+K7wf78KMmmOF9gJPWUKXayfK1OvpfUhuiN56ohx6EIRvrCl/amDlmF+ vqXPrbi5n79cDGn5P47VnIgtWNaQjm+sw7xEpL78nPBONkZFal8NQVpvVPamhPVaowYR 8NVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700463671; x=1701068471; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2en4yv4YpXFN3VCi3B3SISp0lZy/QFymnnSLRtY+3pY=; b=IFiP7t2R0HXv993tFc5xQzb6OBb3WzhUZj/b8qSO5Ivh3BSrhhTXWJNdS79ujogksT 4guOtCn6l1HVPHmYbz1zZtxojbyZbBQHIeSWWl8AVhFIH4VfNOoet+C48ZPkBjpDjJUA DXHBEf4A9ZbOBZIcxImjaBJi2s7wk8lnS6DldT/MRw/NQiKoweWevMEjnCVw/toedXxW WPT58+80DcnPZPkIYtrDMhef2LxehCNslhpakT+0CJL/KuoBdASIeo1FdwjSitKE+MJQ 4JUbcTIcFG0f46jAHh6uMuCEPqLBKJKJOff1mf6bsvcUya2zDNsXGbPhDVn5SgeHL2K/ B9Fw== X-Gm-Message-State: AOJu0Yw3ibZNTrLKMvxB+Ov9pcjUMRmrq28WrXk/7NH319wO5p0uU8UA 7aXwOsPLo2jOW2d18h+8CuS+yg== X-Received: by 2002:ac2:599b:0:b0:503:2deb:bbc1 with SMTP id w27-20020ac2599b000000b005032debbbc1mr4294366lfn.22.1700463670849; Sun, 19 Nov 2023 23:01:10 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.183]) by smtp.gmail.com with ESMTPSA id p2-20020a5d4582000000b003316d1a3b05sm8777667wrq.78.2023.11.19.23.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 23:01:10 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@armlinux.org.uk, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, linus.walleij@linaro.org, p.zabel@pengutronix.de, arnd@arndb.de, m.szyprowski@samsung.com, alexandre.torgue@foss.st.com, afd@ti.com, broonie@kernel.org, alexander.stein@ew.tq-group.com, eugen.hristev@collabora.com, sergei.shtylyov@gmail.com, prabhakar.mahadev-lad.rj@bp.renesas.com, biju.das.jz@bp.renesas.com Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 05/14] pinctrl: renesas: rzg2l: Move arg in the main function block Date: Mon, 20 Nov 2023 09:00:15 +0200 Message-Id: <20231120070024.4079344-6-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231120070024.4079344-1-claudiu.beznea.uj@bp.renesas.com> References: <20231120070024.4079344-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 19 Nov 2023 23:01:51 -0800 (PST) From: Claudiu Beznea Move arg in the main block of the function as this is used by 3 out of 4 case blocks of switch-case. In this way some lines of code are removed. Signed-off-by: Claudiu Beznea --- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 9de350ad7e7d..21ee628363fa 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -842,7 +842,7 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev, struct rzg2l_pinctrl_pin_settings settings = pctrl->settings[_pin]; unsigned int *pin_data = pin->drv_data; enum pin_config_param param; - unsigned int i; + unsigned int i, arg; u32 cfg, off; int ret; u8 bit; @@ -865,8 +865,7 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev, param = pinconf_to_config_param(_configs[i]); switch (param) { case PIN_CONFIG_INPUT_ENABLE: { - unsigned int arg = - pinconf_to_config_argument(_configs[i]); + arg = pinconf_to_config_argument(_configs[i]); if (!(cfg & PIN_CFG_IEN)) return -EINVAL; @@ -880,9 +879,10 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev, break; case PIN_CONFIG_DRIVE_STRENGTH: { - unsigned int arg = pinconf_to_config_argument(_configs[i]); unsigned int index; + arg = pinconf_to_config_argument(_configs[i]); + if (!(cfg & PIN_CFG_IOLH_A) || hwcfg->drive_strength_ua) return -EINVAL; @@ -907,9 +907,10 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev, break; case PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS: { - unsigned int arg = pinconf_to_config_argument(_configs[i]); unsigned int index; + arg = pinconf_to_config_argument(_configs[i]); + if (!(cfg & PIN_CFG_IOLH_B) || !hwcfg->iolh_groupb_oi[0]) return -EINVAL; -- 2.39.2