2015-07-20 06:25:31

by Pan Xinhui

[permalink] [raw]
Subject: [PATCH] cpufreq: ia64: remove redundant freq_table of acpi_cpufreq_data

From: Pan Xinhui <[email protected]>

freq_table is now stored as policy->freq_table, so drop the redundant
freq_table from struct cpufreq_acpi_io.

Signed-off-by: Pan Xinhui <[email protected]>
---
drivers/cpufreq/ia64-acpi-cpufreq.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c
index c30aaa6..e02bd15 100644
--- a/drivers/cpufreq/ia64-acpi-cpufreq.c
+++ b/drivers/cpufreq/ia64-acpi-cpufreq.c
@@ -29,7 +29,6 @@ MODULE_LICENSE("GPL");

struct cpufreq_acpi_io {
struct acpi_processor_performance acpi_data;
- struct cpufreq_frequency_table *freq_table;
unsigned int resume;
};

@@ -221,6 +220,7 @@ acpi_cpufreq_cpu_init (
unsigned int cpu = policy->cpu;
struct cpufreq_acpi_io *data;
unsigned int result = 0;
+ struct cpufreq_frequency_table *freq_table;

pr_debug("acpi_cpufreq_cpu_init\n");

@@ -254,10 +254,10 @@ acpi_cpufreq_cpu_init (
}

/* alloc freq_table */
- data->freq_table = kzalloc(sizeof(*data->freq_table) *
+ freq_table = kzalloc(sizeof(*freq_table) *
(data->acpi_data.state_count + 1),
GFP_KERNEL);
- if (!data->freq_table) {
+ if (!freq_table) {
result = -ENOMEM;
goto err_unreg;
}
@@ -276,14 +276,14 @@ acpi_cpufreq_cpu_init (
for (i = 0; i <= data->acpi_data.state_count; i++)
{
if (i < data->acpi_data.state_count) {
- data->freq_table[i].frequency =
+ freq_table[i].frequency =
data->acpi_data.states[i].core_frequency * 1000;
} else {
- data->freq_table[i].frequency = CPUFREQ_TABLE_END;
+ freq_table[i].frequency = CPUFREQ_TABLE_END;
}
}

- result = cpufreq_table_validate_and_show(policy, data->freq_table);
+ result = cpufreq_table_validate_and_show(policy, freq_table);
if (result) {
goto err_freqfree;
}
@@ -311,7 +311,7 @@ acpi_cpufreq_cpu_init (
return (result);

err_freqfree:
- kfree(data->freq_table);
+ kfree(freq_table);
err_unreg:
acpi_processor_unregister_performance(&data->acpi_data, cpu);
err_free:
--
1.9.1


2015-07-20 09:52:51

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH] cpufreq: ia64: remove redundant freq_table of acpi_cpufreq_data

On 20-07-15, 14:22, Pan Xinhui wrote:
> From: Pan Xinhui <[email protected]>
>
> freq_table is now stored as policy->freq_table, so drop the redundant
> freq_table from struct cpufreq_acpi_io.
>
> Signed-off-by: Pan Xinhui <[email protected]>
> ---
> drivers/cpufreq/ia64-acpi-cpufreq.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)

Acked-by: Viresh Kumar <[email protected]>

--
viresh

2015-07-23 20:38:48

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] cpufreq: ia64: remove redundant freq_table of acpi_cpufreq_data

On Monday, July 20, 2015 03:22:45 PM Viresh Kumar wrote:
> On 20-07-15, 14:22, Pan Xinhui wrote:
> > From: Pan Xinhui <[email protected]>
> >
> > freq_table is now stored as policy->freq_table, so drop the redundant
> > freq_table from struct cpufreq_acpi_io.
> >
> > Signed-off-by: Pan Xinhui <[email protected]>
> > ---
> > drivers/cpufreq/ia64-acpi-cpufreq.c | 15 ++++++++-------
> > 1 file changed, 8 insertions(+), 7 deletions(-)
>
> Acked-by: Viresh Kumar <[email protected]>

Queued up for 4.3, thanks!


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.