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: <Y2NtQgRwkUlU5bMw@black.fi.intel.com>
Date:   Thu, 3 Nov 2022 09:26:58 +0200
From:   Mika Westerberg <mika.westerberg@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andy Shevchenko <andy@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v1 1/2] pinctrl: intel: Use temporary variable for struct
 device

Hi,

On Wed, Nov 02, 2022 at 05:29:14PM +0200, Andy Shevchenko wrote:
> Use temporary variable for struct device to make code neater.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/pinctrl/intel/pinctrl-intel.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
> index fe5bf2184cbf..e15629348cb5 100644
> --- a/drivers/pinctrl/intel/pinctrl-intel.c
> +++ b/drivers/pinctrl/intel/pinctrl-intel.c
> @@ -1522,14 +1522,15 @@ static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl,
>  int intel_pinctrl_probe(struct platform_device *pdev,
>  			const struct intel_pinctrl_soc_data *soc_data)
>  {
> +	struct device *dev = &pdev->dev;
>  	struct intel_pinctrl *pctrl;
>  	int i, ret, irq;
>  
> -	pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
> +	pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);

IMHO &pdev->dev is neater and saves an extra line. I would agree if this
would be something like &foo->bar->baz->dev but it is not.

Anyway, no feelings about this so feel free to add,

Reviewed-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

for both patches.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ