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: <CAJhJPsUBWC6h2ZL_wcqwkd0Krih-PxErVeGFdFdPxocL1RTNcw@mail.gmail.com>
Date:   Wed, 19 Jul 2023 20:30:21 +0800
From:   Keguang Zhang <keguang.zhang@...il.com>
To:     Andrei Coardos <aboutphysycs@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
        linux-mips@...r.kernel.org, andy@...nel.org, brgl@...ev.pl,
        linus.walleij@...aro.org, Alexandru Ardelean <alex@...uggie.ro>
Subject: Re: [PATCH] gpio: loongson1 :remove unneeded platform_set_drvdata()call

On Wed, Jul 19, 2023 at 6:14 PM Andrei Coardos <aboutphysycs@...il.com> wrote:
>
> In the drivers/gpio/gpio-loongson1 the call to platform_set_drvdata was
> removed.
> This function call was found to be unnecesarry as the associated
> structure is defined inside the local .c file.
> It doesn't use any type of function either so it can be removed without
> any complications.

If there is a ls1x_gpio_remove(), platform_get_drvdata() will be called.
Then platform_set_drvdata() will be necessary.
>
> Reviewed-by: Alexandru Ardelean <alex@...uggie.ro>
> Signed-off-by: Andrei Coardos <aboutphysycs@...il.com>
> ---
>  drivers/gpio/gpio-loongson1.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-loongson1.c b/drivers/gpio/gpio-loongson1.c
> index 6ca3b969db4d..2a57ffa0548b 100644
> --- a/drivers/gpio/gpio-loongson1.c
> +++ b/drivers/gpio/gpio-loongson1.c
> @@ -78,8 +78,6 @@ static int ls1x_gpio_probe(struct platform_device *pdev)
>         if (ret)
>                 goto err;
>
> -       platform_set_drvdata(pdev, ls1x_gc);
> -
>         dev_info(dev, "GPIO controller registered with %d pins\n",
>                  ls1x_gc->gc.ngpio);
>
> --
> 2.34.1
>


-- 
Best regards,

Keguang Zhang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ