Re: [PATCH v3] leds: ariel: Add driver for status LEDs on Dell Wyse 3020

From: Pavel Machek
Date: Mon Apr 06 2020 - 16:12:18 EST


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