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]
Date:   Thu, 3 Nov 2022 12:54:23 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        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

On Thu, Nov 3, 2022 at 9:26 AM Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:
> 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.

I have no strong opinion, but one thing which may play in favour of
the patches is that all other drivers, that have their custom
->probe() implemented, are using temporary variable. That said, let's
consider this as unification among Intel pin control drivers.

> Anyway, no feelings about this so feel free to add,
>
> Reviewed-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
>
> for both patches.

Thank you!

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ