lkml.org 
[lkml]   [2015]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] ACPI / processor: Drop an unused argument of a cleanup routine
hi, Rafael
thanks for your nice work :)
On 2015年07月18日 09:14, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> acpi_processor_unregister_performance() actually doesn't use its
> first argument, so drop it and update the callers accordingly.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/acpi/processor_perflib.c | 4 +---
> drivers/cpufreq/acpi-cpufreq.c | 5 ++---
> drivers/cpufreq/e_powersaver.c | 2 +-
> drivers/cpufreq/ia64-acpi-cpufreq.c | 5 ++---
> drivers/cpufreq/powernow-k7.c | 4 ++--
> drivers/cpufreq/powernow-k8.c | 5 ++---
> drivers/xen/xen-acpi-processor.c | 4 ++--
> include/acpi/processor.h | 5 +----
> 8 files changed, 13 insertions(+), 21 deletions(-)
>

I wish I can test this patch. However I only have x86 hardware, not all codes can be tested on my side.

> Index: linux-pm/drivers/xen/xen-acpi-processor.c
> ===================================================================
> --- linux-pm.orig/drivers/xen/xen-acpi-processor.c
> +++ linux-pm/drivers/xen/xen-acpi-processor.c
> @@ -563,7 +563,7 @@ err_unregister:
> for_each_possible_cpu(i) {
> struct acpi_processor_performance *perf;
> perf = per_cpu_ptr(acpi_perf_data, i);
> - acpi_processor_unregister_performance(perf, i);
> + acpi_processor_unregister_performance(i);
> }
> err_out:
> /* Freeing a NULL pointer is OK: alloc_percpu zeroes. */
> @@ -582,7 +582,7 @@ static void __exit xen_acpi_processor_ex
> for_each_possible_cpu(i) {
> struct acpi_processor_performance *perf;
> perf = per_cpu_ptr(acpi_perf_data, i);
> - acpi_processor_unregister_performance(perf, i);
> + acpi_processor_unregister_performance(i);


> }
> free_acpi_perf_data();
> }
>

After a simple review, in functions above *perf* is not used anymore, can we just change the codes like below
@@ -580,9 +580,7 @@ static void __exit xen_acpi_processor_exit(void)
kfree(acpi_id_present);
kfree(acpi_id_cst_present);
for_each_possible_cpu(i) {
- struct acpi_processor_performance *perf;
- perf = per_cpu_ptr(acpi_perf_data, i);
- acpi_processor_unregister_performance(perf, i);
+ acpi_processor_unregister_performance(i);
}
free_acpi_perf_data();

thanks
xinhui


\
 
 \ /
  Last update: 2015-07-20 04:01    [W:0.097 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site