lkml.org 
[lkml]   [2011]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: 88pm8607: Fix off-by-one value range checking in the case of no id is matched
On Thu, Aug 04, 2011 at 04:18:11PM +0800, Axel Lin wrote:
> In the case of no id is matched, the variable i is equal to
> ARRAY_SIZE(pm8607_regulator_info).
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> I think compare variable i with ARRAY_SIZE(pm8607_regulator_info) here is slightly
> better in readability than compare with PM8607_ID_RG_MAX.

It should be more robust I guess.


\
 
 \ /
  Last update: 2011-08-04 10:25    [W:0.119 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site