lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200406201213.GB18036@bug>
Date:   Mon, 6 Apr 2020 22:12:13 +0200
From:   Pavel Machek <pavel@....cz>
To:     Dan Murphy <dmurphy@...com>
Cc:     Lubomir Rintel <lkundrak@...sk>,
        Jacek Anaszewski <jacek.anaszewski@...il.com>,
        linux-kernel@...r.kernel.org, linux-leds@...r.kernel.org
Subject: Re: [PATCH v3] leds: ariel: Add driver for status LEDs on Dell Wyse
 3020

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ