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: <539b3cd4-8af3-d6d8-f5a9-2c426a1f0faa@codethink.co.uk>
Date:   Tue, 12 Mar 2019 09:17:48 +0000
From:   Ben Dooks <ben.dooks@...ethink.co.uk>
To:     "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        linux-kernel@...r.kernel.org
Cc:     linus.walleij@...aro.org, bgolaszewski@...libre.com,
        andrew@...id.au, f.fainelli@...il.com, sbranden@...adcom.com,
        bcm-kernel-feedback-list@...adcom.com, hoan@...amperecomputing.com,
        orsonzhai@...il.com, baolin.wang@...aro.org, zhang.lyra@...il.com,
        keguang.zhang@...il.com, vz@...ia.com, matthias.bgg@...il.com,
        thierry.reding@...il.com, grygorii.strashko@...com,
        ssantosh@...nel.org, khilman@...nel.org, robert.jarzmik@...e.fr,
        yamada.masahiro@...ionext.com, jun.nie@...aro.org,
        shawnguo@...nel.org, linux-gpio@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-pwm@...r.kernel.org,
        linux-omap@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH 16/42] drivers: gpio: janz-ttl: drop unneccessary temp
 variable dev

On 11/03/2019 18:54, Enrico Weigelt, metux IT consult wrote:
> don't need the temporary variable "dev", directly use &pdev->dev
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@...ux.net>

This is quite usual to do, and I like it as it saves typing.
Personally I would say don't bother with this change.

> ---
>   drivers/gpio/gpio-janz-ttl.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c
> index b97a911..91f91f6 100644
> --- a/drivers/gpio/gpio-janz-ttl.c
> +++ b/drivers/gpio/gpio-janz-ttl.c
> @@ -144,18 +144,17 @@ static void ttl_setup_device(struct ttl_module *mod)
>   static int ttl_probe(struct platform_device *pdev)
>   {
>   	struct janz_platform_data *pdata;
> -	struct device *dev = &pdev->dev;
>   	struct ttl_module *mod;
>   	struct gpio_chip *gpio;
>   	int ret;
>   
>   	pdata = dev_get_platdata(&pdev->dev);
>   	if (!pdata) {
> -		dev_err(dev, "no platform data\n");
> +		dev_err(&pdev->dev, "no platform data\n");
>   		return -ENXIO;
>   	}
>   
> -	mod = devm_kzalloc(dev, sizeof(*mod), GFP_KERNEL);
> +	mod = devm_kzalloc(&pdev->dev, sizeof(*mod), GFP_KERNEL);
>   	if (!mod)
>   		return -ENOMEM;
>   
> @@ -181,9 +180,9 @@ static int ttl_probe(struct platform_device *pdev)
>   	gpio->base = -1;
>   	gpio->ngpio = 20;
>   
> -	ret = devm_gpiochip_add_data(dev, gpio, NULL);
> +	ret = devm_gpiochip_add_data(&pdev->dev, gpio, NULL);
>   	if (ret) {
> -		dev_err(dev, "unable to add GPIO chip\n");
> +		dev_err(&pdev->dev, "unable to add GPIO chip\n");
>   		return ret;
>   	}
>   
> 


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ