[PATCH 4/4] cpufreq: imx6q: correct VDDSOC/PU voltage scaling when cpufreq is changed

Lothar Waßmann LW at KARO-electronics.de
Wed Dec 18 03:30:46 EST 2013


Hi,

Shawn Guo wrote:
> On Tue, Dec 17, 2013 at 10:53:47AM +0100, Lothar Waßmann wrote:
> > > > +	if (soc_opp_index >= soc_opp_count) {
> > > 
> > > Can soc_opp_index be possibly greater than soc_opp_count?  Otherwise,
> > > the condition check below is good enough?
> > > 
> > > 	if (soc_opp_index == soc_opp_count)
> > >
> > it doen't harm to be on the safe side and use >= anyway!
> 
> Well, it may confuse reader.  At least, it took me some time understand
> how that ">" condition will happen.  And it turns out never.
> 
man "defensive programming"


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________



More information about the linux-arm-kernel mailing list