From: Eddie James <eajames@linux.ibm.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Joel Stanley <joel@jms.id.au>, Pavel Machek <pavel@ucw.cz>,
Linux LED Subsystem <linux-leds@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] leds: pca955x: Clean up and optimize
Date: Mon, 11 Apr 2022 10:17:14 -0500 [thread overview]
Message-ID: <47f566cc-bdff-0f4f-557d-b069100911c3@linux.ibm.com> (raw)
In-Reply-To: <CAHp75VedZdEYB-BjJTVaKJgPwQ9a1DhTp=MYsrh1Ve9Eyfnytw@mail.gmail.com>
On 4/8/22 06:11, Andy Shevchenko wrote:
> On Thu, Apr 7, 2022 at 10:42 PM Eddie James <eajames@linux.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.
Ack.
>
>> + 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);
Hm, I still end up having to use two lines for the dev_err function, so
not sure it's worth it?
>
> ...
>
>> + 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.
Ack.
Thanks for the review!
Eddie
>
next prev parent reply other threads:[~2022-04-11 15:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 18:39 [PATCH v2 0/2] leds: pca955x: Add HW blink support Eddie James
2022-04-07 18:39 ` [PATCH v2 1/2] leds: pca955x: Clean up and optimize Eddie James
2022-04-08 11:11 ` Andy Shevchenko
2022-04-11 15:17 ` Eddie James [this message]
2022-04-07 18:39 ` [PATCH v2 2/2] leds: pca955x: Add HW blink support Eddie James
2022-04-08 11:19 ` Andy Shevchenko
2022-04-11 16:06 ` Eddie James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47f566cc-bdff-0f4f-557d-b069100911c3@linux.ibm.com \
--to=eajames@linux.ibm.com \
--cc=andy.shevchenko@gmail.com \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).