All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Dan Murphy <dmurphy@ti.com>
Cc: Lubomir Rintel <lkundrak@v3.sk>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH v3] leds: ariel: Add driver for status LEDs on Dell Wyse 3020
Date: Mon, 6 Apr 2020 22:12:13 +0200	[thread overview]
Message-ID: <20200406201213.GB18036@bug> (raw)
In-Reply-To: <ef7e8f03-0a43-156e-b86e-3ab3887f0245@ti.com>

Hi!

> >+enum ec_index {
> >+	EC_BLUE_LED	= 0x01,
> >+	EC_AMBER_LED	= 0x02,
> 
> Defining the value after the 0x0 is unnecessary as enums are incremental
> only the first value needs to be defined if the following values are in
> numerical order
> 
> Can these also be #defined instead of an enum??? Not requesting them to be
> just wondering about the design decision here.

enum is okay here.

> >+	EC_GREEN_LED	= 0x03,
> >+};
> >+
> >+enum {
> >+	EC_LED_OFF	= 0x00,
> >+	EC_LED_STILL	= 0x01,
> Same comment as above
> >+	EC_LED_FADE	= 0x02,
> >+	EC_LED_BLINK	= 0x03,
> >+};

If the values are shared with hardware (and they are), making them explicit is right thing 
to do.

> >+#define NLEDS 3
> 
> This define needs to be more unique.

Why?

> Something like EC_NLEDS or EC_NUM_LEDS and should be moved to the top of the file under 
> the #includes

I'd do it that way, but I would not request new patch version just for that.

Best regards,

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2020-04-06 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-22  7:41 [PATCH v3] leds: ariel: Add driver for status LEDs on Dell Wyse 3020 Lubomir Rintel
2020-04-03 19:37 ` Dan Murphy
2020-04-06 20:12   ` Pavel Machek [this message]
2020-04-17  9:58   ` Lubomir Rintel
2020-04-24  9:18     ` Pavel Machek

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=20200406201213.GB18036@bug \
    --to=pavel@ucw.cz \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.