Re: [PATCH 06/10 V3] omap3: pm: use opp accessor functions for omap-target

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

 



Hello Nishanth,

Little style comment.

On Wed, Nov 25, 2009 at 06:56:08PM +0100, ext Kevin Hilman wrote:
> Nishanth Menon <nm@xxxxxx> writes:
> 
> > The logic in omap-target can now be improved with the accessor
> > functions. Dont scan through the list manually, instead use
> > get_next_freq to do the scanning.
> >
> > Cc: Benoit Cousson <b-cousson@xxxxxx>
> > Cc: Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx>
> > Cc: Madhusudhan Chikkature Rajashekar <madhu.cr@xxxxxx>
> > Cc: Paul Walmsley <paul@xxxxxxxxx>
> > Cc: Romit Dasgupta <romit@xxxxxx>
> > Cc: Sanjeev Premi <premi@xxxxxx>
> > Cc: Santosh Shilimkar <santosh.shilimkar@xxxxxx>
> > Cc: Sergio Alberto Aguirre Rodriguez <saaguirre@xxxxxx>
> > Cc: Thara Gopinath <thara@xxxxxx>
> > Cc: Vishwanath Sripathy <vishwanath.bs@xxxxxx>
> >
> > Signed-off-by: Nishanth Menon <nm@xxxxxx>
> > ---
> >  arch/arm/plat-omap/cpu-omap.c |   19 +++++++++++--------
> >  1 files changed, 11 insertions(+), 8 deletions(-)
> >
> > diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
> > index 449b6b6..7b3ca11 100644
> > --- a/arch/arm/plat-omap/cpu-omap.c
> > +++ b/arch/arm/plat-omap/cpu-omap.c
> > @@ -111,14 +111,17 @@ static int omap_target(struct cpufreq_policy *policy,
> >  	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
> >  #elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
> >  	if (mpu_opps) {
> > -		int ind;
> > -		for (ind = 1; ind <= MAX_VDD1_OPP; ind++) {
> > -			if (mpu_opps[ind].rate/1000 >= target_freq) {
> > -				omap_pm_cpu_set_freq
> > -					(mpu_opps[ind].rate);
> > -				break;
> > -			}
> > -		}
> > +		unsigned long freq = target_freq * 1000;
> > +		struct omap_opp *opp = NULL;
> > +		int res;

Not mandatory, but add a blank line to separate declaration from rest of the code.

> > +		/* see if we have exact freq match */
> > +		res = opp_is_valid(&opp, mpu_opps, freq);
> > +		/* Get next best if we cant find a exact match */
> > +		if (res)
> > +			res = opp_get_higher_opp(&opp, &freq, mpu_opps);
> 
> These two could just be replaced by a single call to
> opp_find_freq_rounding()

Indeed, I also agree here that having a "find_rounded" as a search option
would make sense.

> 
> Kevin
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Eduardo Valentin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux