Re: [RFC PATCH] leds: core: Fix LED_COLOR_MAX_ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: Digital signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux