From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: oss@c-mauderer.de, linux-leds@vger.kernel.org,
devicetree@vger.kernel.org, Dan Murphy <dmurphy@ti.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH v2 2/2] leds: spi-byte: add single byte SPI LED driver
Date: Mon, 6 May 2019 20:19:45 +0200 [thread overview]
Message-ID: <1c318194-f57f-4807-5f94-8cca8e1c4b9e@gmail.com> (raw)
In-Reply-To: <20190505201218.GA21957@amd>
On 5/5/19 10:12 PM, Pavel Machek wrote:
> Hi!
>
>>> + led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL);
>>> + if (!led)
>>> + return -ENOMEM;
>>> +
>>> + led->spi = spi;
>>> + strlcpy(led->name, name, sizeof(led->name));
>>> + mutex_init(&led->mutex);
>>> + led->off_value = off_value;
>>> + led->max_value = max_value;
>>> + led->ldev.name = led->name;
>>> + led->ldev.brightness = LED_OFF;
>>
>> This line is redundant - already zeroed by kzalloc.
>
> Actually I'd prefer to leave it in. Yes, LED_OFF == 0, and will
> probably stay == 0 in future, but...
but what? I don't really see a sufficient justification for
leaving it. Just redundant line. In other place in my LED naming
patch set you wondered if it wouldn't have been better to initialize
a struct partly using initialization list, I suspect to save few
LOC. So here you seem to be inconsistent :-)
--
Best regards,
Jacek Anaszewski
prev parent reply other threads:[~2019-05-06 18:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-05 12:52 [PATCH v2 1/2] dt-bindings: leds: Add binding for spi-byte LED oss
2019-05-05 12:52 ` [PATCH v2 2/2] leds: spi-byte: add single byte SPI LED driver oss
2019-05-05 14:48 ` Jacek Anaszewski
2019-05-05 14:55 ` Christian Mauderer
2019-05-05 20:12 ` Pavel Machek
2019-05-06 8:48 ` Christian Mauderer
2019-05-06 18:34 ` Jacek Anaszewski
2019-05-06 18:19 ` Jacek Anaszewski [this message]
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=1c318194-f57f-4807-5f94-8cca8e1c4b9e@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dmurphy@ti.com \
--cc=linux-leds@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=oss@c-mauderer.de \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
/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).