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: <7dc4da15-28a4-4e1f-b0c9-9115f97edd77@ti.com>
Date: Sun, 7 Sep 2025 09:09:57 -0500
From: Andrew Davis <afd@...com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Linus Walleij
	<linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>
CC: <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
        <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH] gpio: pisosr: Use devm_mutex_init()

On 9/7/25 8:25 AM, Christophe JAILLET wrote:
> Use devm_mutex_init() instead of hand-writing it.
> 
> This saves some LoC, improves readability and saves some space in the
> generated .o file.
> 
> Before:
> ======
>     text	   data	    bss	    dec	    hex	filename
>     8431	   1808	    192	  10431	   28bf	drivers/gpio/gpio-pisosr.o
> 
> After:
> =====
>     text	   data	    bss	    dec	    hex	filename
>     8112	   1736	    192	  10040	   2738	drivers/gpio/gpio-pisosr.o
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---

Acked-by: Andrew Davis <afd@...com>

>   drivers/gpio/gpio-pisosr.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c
> index a69b74866a13..7ec6a46ed600 100644
> --- a/drivers/gpio/gpio-pisosr.c
> +++ b/drivers/gpio/gpio-pisosr.c
> @@ -108,11 +108,6 @@ static const struct gpio_chip template_chip = {
>   	.can_sleep		= true,
>   };
>   
> -static void pisosr_mutex_destroy(void *lock)
> -{
> -	mutex_destroy(lock);
> -}
> -
>   static int pisosr_gpio_probe(struct spi_device *spi)
>   {
>   	struct device *dev = &spi->dev;
> @@ -139,8 +134,7 @@ static int pisosr_gpio_probe(struct spi_device *spi)
>   		return dev_err_probe(dev, PTR_ERR(gpio->load_gpio),
>   				     "Unable to allocate load GPIO\n");
>   
> -	mutex_init(&gpio->lock);
> -	ret = devm_add_action_or_reset(dev, pisosr_mutex_destroy, &gpio->lock);
> +	ret = devm_mutex_init(dev, &gpio->lock);
>   	if (ret)
>   		return ret;
>   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ