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: <CAHp75VedZdEYB-BjJTVaKJgPwQ9a1DhTp=MYsrh1Ve9Eyfnytw@mail.gmail.com>
Date:   Fri, 8 Apr 2022 14:11:05 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Eddie James <eajames@...ux.ibm.com>
Cc:     Linux LED Subsystem <linux-leds@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Pavel Machek <pavel@....cz>,
        OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
        Joel Stanley <joel@....id.au>, patrick@...cx.xyz
Subject: Re: [PATCH v2 1/2] leds: pca955x: Clean up and optimize

On Thu, Apr 7, 2022 at 10:42 PM Eddie James <eajames@...ux.ibm.com> wrote:
>
> Clean up the I2C access functions to avoid fetching the pca955x
> driver data again. Optimize the probe to do at most 4 reads and
> 4 writes of the LED selector regs, rather than 16 of each.

> Rename some functions and variables to be more consistent and
> descriptive.

Separate patch.

> +               dev_err(&pca955x->client->dev,
> +                       "%s: reg 0x%x, val 0x%x, err %d\n", __func__, n, val,
> +                       ret);

This can be indented better.

I would add a temporary dev pointer variable and put this on one line.

 struct device *dev = &pca955x->client->dev;

               dev_err(dev, "%s: reg 0x%x, val 0x%x, err %d\n",
__func__, n, val, ret);

...

> +               dev_err(&pca955x->client->dev,
> +                       "%s: reg 0x%x, val 0x%x, err %d\n", __func__, n, val,
> +                       ret);

Ditto.

...

> +               dev_err(&pca955x->client->dev,
> +                       "%s: reg 0x%x, val 0x%x, err %d\n", __func__, n, val,
> +                       ret);

Ditto.

...

> +               dev_err(&pca955x->client->dev, "%s: reg 0x%x, err %d\n",
>                         __func__, n, ret);

Ditto.

...

> +               dev_err(&pca955x->client->dev, "%s: reg 0x%x, err %d\n",
>                         __func__, n, ret);

Ditto.

...

> +       struct pca955x_led *pca955x_led = container_of(led_cdev,
> +                                                      struct pca955x_led,
> +                                                      led_cdev);

Is it used once? If more than once, consider a helper for that as well.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ