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: <af986bd3-0bb4-4888-861a-33fa09a7d139@nvidia.com>
Date: Wed, 14 Jan 2026 15:51:36 +0000
From: Jon Hunter <jonathanh@...dia.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>,
 Andrew Jeffery <andrew@...econstruct.com.au>,
 Linus Walleij <linusw@...nel.org>, Joel Stanley <joel@....id.au>,
 Emil Renner Berthing <kernel@...il.dk>, Hal Feng
 <hal.feng@...rfivetech.com>, Chen Wang <unicorn_wang@...look.com>,
 Inochi Amaoto <inochiama@...il.com>,
 Basavaraj Natikar <Basavaraj.Natikar@....com>,
 Shyam Sundar S K <Shyam-sundar.S-k@....com>,
 Bartosz Golaszewski <brgl@...nel.org>,
 Steen Hegelund <Steen.Hegelund@...rochip.com>,
 Daniel Machon <daniel.machon@...rochip.com>, UNGLinuxDriver@...rochip.com,
 Thierry Reding <thierry.reding@...il.com>, Heiko Stuebner <heiko@...ech.de>,
 Patrice Chotard <patrice.chotard@...s.st.com>
Cc: linux-aspeed@...ts.ozlabs.org, openbmc@...ts.ozlabs.org,
 linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org, sophgo@...ts.linux.dev,
 linux-tegra@...r.kernel.org, linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH 09/11] pinctrl: tegra-xusb: Simplify locking with guard()


On 14/01/2026 15:30, Krzysztof Kozlowski wrote:
> Simplify error handling (less gotos) over locks with guard().
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
> ---
>   drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 14 +++++---------
>   1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
> index 34a373f7e04d..855f708ce510 100644
> --- a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
> +++ b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
> @@ -478,10 +478,10 @@ static void tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
>   {
>   	u32 value;
>   
> -	mutex_lock(&padctl->lock);
> +	guard(mutex)(&padctl->lock);
>   
>   	if (padctl->enable++ > 0)
> -		goto out;
> +		return;
>   
>   	value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM);
>   	value &= ~XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN;
> @@ -499,7 +499,6 @@ static void tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
>   	value &= ~XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN;
>   	padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM);
>   
> -out:
>   	mutex_unlock(&padctl->lock);
>   }


I believe we need to remove the above unlock too?

Jon

-- 
nvpublic


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ