Message ID | 20170510092700.18357-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 2017-05-10 02:27 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > We may as way hint to the compiler that the tiny one-line helper > functions cpu_set_lowest_frequency and cpu_set_highest_frequency > can be inlined. They probably are already, but hinting it may be > useful. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/cpu/cpufreq/cpufreq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c > index 1cfac3aa..630d0cdf 100644 > --- a/src/cpu/cpufreq/cpufreq.c > +++ b/src/cpu/cpufreq/cpufreq.c > @@ -136,12 +136,12 @@ out: > return rc; > } > > -static int cpu_set_lowest_frequency(fwts_framework *fw, struct cpu *cpu) > +static inline int cpu_set_lowest_frequency(fwts_framework *fw, struct cpu *cpu) > { > return cpu_set_frequency(fw, cpu, cpu->freqs[0].Hz); > } > > -static int cpu_set_highest_frequency(fwts_framework *fw, struct cpu *cpu) > +static inline int cpu_set_highest_frequency(fwts_framework *fw, struct cpu *cpu) > { > return cpu_set_frequency(fw, cpu, cpu->freqs[cpu->n_freqs-1].Hz); > } > Acked-by: Alex Hung <alex.hung@canonical.com>
On 05/10/2017 05:27 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > We may as way hint to the compiler that the tiny one-line helper > functions cpu_set_lowest_frequency and cpu_set_highest_frequency > can be inlined. They probably are already, but hinting it may be > useful. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/cpu/cpufreq/cpufreq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c > index 1cfac3aa..630d0cdf 100644 > --- a/src/cpu/cpufreq/cpufreq.c > +++ b/src/cpu/cpufreq/cpufreq.c > @@ -136,12 +136,12 @@ out: > return rc; > } > > -static int cpu_set_lowest_frequency(fwts_framework *fw, struct cpu *cpu) > +static inline int cpu_set_lowest_frequency(fwts_framework *fw, struct cpu *cpu) > { > return cpu_set_frequency(fw, cpu, cpu->freqs[0].Hz); > } > > -static int cpu_set_highest_frequency(fwts_framework *fw, struct cpu *cpu) > +static inline int cpu_set_highest_frequency(fwts_framework *fw, struct cpu *cpu) > { > return cpu_set_frequency(fw, cpu, cpu->freqs[cpu->n_freqs-1].Hz); > } Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c index 1cfac3aa..630d0cdf 100644 --- a/src/cpu/cpufreq/cpufreq.c +++ b/src/cpu/cpufreq/cpufreq.c @@ -136,12 +136,12 @@ out: return rc; } -static int cpu_set_lowest_frequency(fwts_framework *fw, struct cpu *cpu) +static inline int cpu_set_lowest_frequency(fwts_framework *fw, struct cpu *cpu) { return cpu_set_frequency(fw, cpu, cpu->freqs[0].Hz); } -static int cpu_set_highest_frequency(fwts_framework *fw, struct cpu *cpu) +static inline int cpu_set_highest_frequency(fwts_framework *fw, struct cpu *cpu) { return cpu_set_frequency(fw, cpu, cpu->freqs[cpu->n_freqs-1].Hz); }