From: Pavel Machek <pavel@ucw.cz>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
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: Sun, 5 May 2019 22:12:18 +0200 [thread overview]
Message-ID: <20190505201218.GA21957@amd> (raw)
In-Reply-To: <da311a7e-0d3b-5c60-5bed-06446e71e5ff@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 672 bytes --]
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...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2019-05-05 20:12 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 [this message]
2019-05-06 8:48 ` Christian Mauderer
2019-05-06 18:34 ` Jacek Anaszewski
2019-05-06 18:19 ` Jacek Anaszewski
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=20190505201218.GA21957@amd \
--to=pavel@ucw.cz \
--cc=devicetree@vger.kernel.org \
--cc=dmurphy@ti.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-leds@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=oss@c-mauderer.de \
--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).