lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230609082539.24311-4-raag.jadav@intel.com>
Date:   Fri,  9 Jun 2023 13:55:38 +0530
From:   Raag Jadav <raag.jadav@...el.com>
To:     linus.walleij@...aro.org, mika.westerberg@...ux.intel.com,
        andriy.shevchenko@...ux.intel.com
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        mallikarjunappa.sangannavar@...el.com, pandith.n@...el.com,
        Raag Jadav <raag.jadav@...el.com>
Subject: [PATCH v2 3/4] pinctrl: intel: simplify exit path of set_mux hook

Simplify exit path of ->set_mux() hook and save a few bytes.

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-22 (-22)
Function                                     old     new   delta
intel_pinmux_set_mux                         242     220     -22
Total: Before=10453, After=10431, chg -0.21%

Signed-off-by: Raag Jadav <raag.jadav@...el.com>
---
 drivers/pinctrl/intel/pinctrl-intel.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 3f78066b1837..2338e84615cc 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -393,7 +393,7 @@ static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev,
 	struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
 	const struct intel_pingroup *grp = &pctrl->soc->groups[group];
 	unsigned long flags;
-	int i;
+	int i, ret = 0;
 
 	raw_spin_lock_irqsave(&pctrl->lock, flags);
 
@@ -403,8 +403,8 @@ static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev,
 	 */
 	for (i = 0; i < grp->grp.npins; i++) {
 		if (!intel_pad_usable(pctrl, grp->grp.pins[i])) {
-			raw_spin_unlock_irqrestore(&pctrl->lock, flags);
-			return -EBUSY;
+			ret = -EBUSY;
+			goto out_unlock;
 		}
 	}
 
@@ -427,9 +427,10 @@ static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev,
 		writel(value, padcfg0);
 	}
 
+out_unlock:
 	raw_spin_unlock_irqrestore(&pctrl->lock, flags);
 
-	return 0;
+	return ret;
 }
 
 static void __intel_gpio_set_direction(void __iomem *padcfg0, bool input)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ