[v3] cpufreq: CPPC: simply the code access 'highest_perf' value in cppc_perf_caps struct
diff mbox series

Message ID 20200701042007.13333-1-xhao@linux.alibaba.com
State New
Delegated to: viresh kumar
Headers show
Series
  • [v3] cpufreq: CPPC: simply the code access 'highest_perf' value in cppc_perf_caps struct
Related show

Commit Message

Xin Hao July 1, 2020, 4:20 a.m. UTC
The 'caps' variable has been defined, so there is no need to get
 'highest_perf' value through 'cpu->caps.highest_perf', you can use
 'caps->highest_perf' instead.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Viresh Kumar July 1, 2020, 4:52 a.m. UTC | #1
On 01-07-20, 12:20, Xin Hao wrote:
>  The 'caps' variable has been defined, so there is no need to get
>  'highest_perf' value through 'cpu->caps.highest_perf', you can use
>  'caps->highest_perf' instead.
> 
> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> ---
>  drivers/cpufreq/cppc_cpufreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 257d726a4456..051d0e56c67a 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -161,7 +161,7 @@ static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu,
>  		if (!max_khz)
>  			max_khz = cppc_get_dmi_max_khz();
>  		mul = max_khz;
> -		div = cpu->perf_caps.highest_perf;
> +		div = caps->highest_perf;
>  	}
>  	return (u64)perf * mul / div;
>  }
> @@ -184,7 +184,7 @@ static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu,
>  	} else {
>  		if (!max_khz)
>  			max_khz = cppc_get_dmi_max_khz();
> -		mul = cpu->perf_caps.highest_perf;
> +		mul = caps->highest_perf;
>  		div = max_khz;
>  	}

Applied. Thanks.
Rafael J. Wysocki July 1, 2020, 12:16 p.m. UTC | #2
On Wed, Jul 1, 2020 at 6:52 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 01-07-20, 12:20, Xin Hao wrote:
> >  The 'caps' variable has been defined, so there is no need to get
> >  'highest_perf' value through 'cpu->caps.highest_perf', you can use
> >  'caps->highest_perf' instead.
> >
> > Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> > ---
> >  drivers/cpufreq/cppc_cpufreq.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> > index 257d726a4456..051d0e56c67a 100644
> > --- a/drivers/cpufreq/cppc_cpufreq.c
> > +++ b/drivers/cpufreq/cppc_cpufreq.c
> > @@ -161,7 +161,7 @@ static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu,
> >               if (!max_khz)
> >                       max_khz = cppc_get_dmi_max_khz();
> >               mul = max_khz;
> > -             div = cpu->perf_caps.highest_perf;
> > +             div = caps->highest_perf;
> >       }
> >       return (u64)perf * mul / div;
> >  }
> > @@ -184,7 +184,7 @@ static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu,
> >       } else {
> >               if (!max_khz)
> >                       max_khz = cppc_get_dmi_max_khz();
> > -             mul = cpu->perf_caps.highest_perf;
> > +             mul = caps->highest_perf;
> >               div = max_khz;
> >       }
>
> Applied. Thanks.

I applied the previous cppc_cpufreq patch, hopefully it will not clash
with this one.

Are you going to take care of this driver going forward?
Viresh Kumar July 2, 2020, 2:37 a.m. UTC | #3
On 01-07-20, 14:16, Rafael J. Wysocki wrote:
> On Wed, Jul 1, 2020 at 6:52 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> >
> > On 01-07-20, 12:20, Xin Hao wrote:
> > >  The 'caps' variable has been defined, so there is no need to get
> > >  'highest_perf' value through 'cpu->caps.highest_perf', you can use
> > >  'caps->highest_perf' instead.
> > >
> > > Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> > > ---
> > >  drivers/cpufreq/cppc_cpufreq.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> > > index 257d726a4456..051d0e56c67a 100644
> > > --- a/drivers/cpufreq/cppc_cpufreq.c
> > > +++ b/drivers/cpufreq/cppc_cpufreq.c
> > > @@ -161,7 +161,7 @@ static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu,
> > >               if (!max_khz)
> > >                       max_khz = cppc_get_dmi_max_khz();
> > >               mul = max_khz;
> > > -             div = cpu->perf_caps.highest_perf;
> > > +             div = caps->highest_perf;
> > >       }
> > >       return (u64)perf * mul / div;
> > >  }
> > > @@ -184,7 +184,7 @@ static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu,
> > >       } else {
> > >               if (!max_khz)
> > >                       max_khz = cppc_get_dmi_max_khz();
> > > -             mul = cpu->perf_caps.highest_perf;
> > > +             mul = caps->highest_perf;
> > >               div = max_khz;
> > >       }
> >
> > Applied. Thanks.
> 
> I applied the previous cppc_cpufreq patch, hopefully it will not clash
> with this one.
> 
> Are you going to take care of this driver going forward?

I started picking up the patches for this driver as it was mostly ARM
stuff and FWIW, I picked the previous one as well and because it was
sent by me, I never replied with the "Applied" message :)

Will it be possible for you to drop that one? Or should I drop that
now ? There shouldn't be any conflicts for now though.
Rafael J. Wysocki July 2, 2020, 11:06 a.m. UTC | #4
On Thu, Jul 2, 2020 at 4:37 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 01-07-20, 14:16, Rafael J. Wysocki wrote:
> > On Wed, Jul 1, 2020 at 6:52 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > >
> > > On 01-07-20, 12:20, Xin Hao wrote:
> > > >  The 'caps' variable has been defined, so there is no need to get
> > > >  'highest_perf' value through 'cpu->caps.highest_perf', you can use
> > > >  'caps->highest_perf' instead.
> > > >
> > > > Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> > > > ---
> > > >  drivers/cpufreq/cppc_cpufreq.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> > > > index 257d726a4456..051d0e56c67a 100644
> > > > --- a/drivers/cpufreq/cppc_cpufreq.c
> > > > +++ b/drivers/cpufreq/cppc_cpufreq.c
> > > > @@ -161,7 +161,7 @@ static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu,
> > > >               if (!max_khz)
> > > >                       max_khz = cppc_get_dmi_max_khz();
> > > >               mul = max_khz;
> > > > -             div = cpu->perf_caps.highest_perf;
> > > > +             div = caps->highest_perf;
> > > >       }
> > > >       return (u64)perf * mul / div;
> > > >  }
> > > > @@ -184,7 +184,7 @@ static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu,
> > > >       } else {
> > > >               if (!max_khz)
> > > >                       max_khz = cppc_get_dmi_max_khz();
> > > > -             mul = cpu->perf_caps.highest_perf;
> > > > +             mul = caps->highest_perf;
> > > >               div = max_khz;
> > > >       }
> > >
> > > Applied. Thanks.
> >
> > I applied the previous cppc_cpufreq patch, hopefully it will not clash
> > with this one.
> >
> > Are you going to take care of this driver going forward?
>
> I started picking up the patches for this driver as it was mostly ARM
> stuff and FWIW, I picked the previous one as well and because it was
> sent by me, I never replied with the "Applied" message :)

But you could respond to the "applied" message from me. :-)

> Will it be possible for you to drop that one?

Dropped now and I will be assuming that you will pick up cppc_cpufreq
patches from now on.

Thanks!
Viresh Kumar July 2, 2020, 11:09 a.m. UTC | #5
On 02-07-20, 13:06, Rafael J. Wysocki wrote:
> But you could respond to the "applied" message from me. :-)

Haha. I was expecting you to pick the other patches (around governor
cleanup) from me and I completely missed that you picked cppc one as
well. In fact, I had to go to the thread again now to check if you
replied at all :)

Sorry about that. My fault.

Patch
diff mbox series

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 257d726a4456..051d0e56c67a 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -161,7 +161,7 @@  static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu,
 		if (!max_khz)
 			max_khz = cppc_get_dmi_max_khz();
 		mul = max_khz;
-		div = cpu->perf_caps.highest_perf;
+		div = caps->highest_perf;
 	}
 	return (u64)perf * mul / div;
 }
@@ -184,7 +184,7 @@  static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu,
 	} else {
 		if (!max_khz)
 			max_khz = cppc_get_dmi_max_khz();
-		mul = cpu->perf_caps.highest_perf;
+		mul = caps->highest_perf;
 		div = max_khz;
 	}