linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Dan Murphy <dmurphy@ti.com>
Cc: jacek.anaszewski@gmail.com, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] leds: core: Fix LED_COLOR_MAX_ID
Date: Wed, 2 Oct 2019 20:36:03 +0200	[thread overview]
Message-ID: <20191002183603.GC13492@amd> (raw)
In-Reply-To: <20191002163400.25317-1-dmurphy@ti.com>

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

On Wed 2019-10-02 11:34:00, Dan Murphy wrote:
> The LED_COLOR_MAX_ID is incorrect.  THe MAX_ID should
> be the last COLOR_ID in the list.  If an array was allocate
> with MAX_ID the allocation would be correct but the meaning
> is wrong.
> 
> So for array allocation the code should use LED_NUM_COLOR_IDS
> which will allocate MAX_ID + 1.  Whent the code needs to validate
> that the color ID is not out of bounds then the code should use
> LED_COLOR_MAX_ID.

Renaming original define might have been okay. Having two defines is
not. I'd say we can keep it as is...

								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 --]

  reply	other threads:[~2019-10-02 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 16:34 [RFC PATCH] leds: core: Fix LED_COLOR_MAX_ID Dan Murphy
2019-10-02 18:36 ` Pavel Machek [this message]
2019-10-02 18:42   ` Dan Murphy

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=20191002183603.GC13492@amd \
    --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 \
    /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).