From: mochel@linux.intel.com
To: linux-acpi@vger.kernel.org
Cc: Patrick Mochel <mochel@linux.intel.com>
Subject: [PATCH 20/24] Remove unneeded debugging macros in drivers/acpi/processor_perflib.c
Date: Mon, 17 Apr 2006 18:21:55 -0700 [thread overview]
Message-ID: <11453233154124-git-send-email-mochel@linux.intel.com> (raw)
In-Reply-To: <11453233151054-git-send-email-mochel@linux.intel.com>
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/processor_perflib.c | 105 ++++++++++++++------------------------
1 files changed, 38 insertions(+), 67 deletions(-)
applies-to: c9fce8cafc46d108ef9d5e396a15447e82d53151
68dba1dee647266a54bddaff530d8b05aab558d6
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 3dd4284..6e22004 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -107,10 +107,8 @@ static int acpi_processor_get_platform_l
acpi_status status = 0;
unsigned long ppc = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_get_platform_limit");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/*
* _PPC indicates the maximum state currently supported by the platform
@@ -123,12 +121,12 @@ static int acpi_processor_get_platform_l
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
pr->performance_platform_limit = (int)ppc;
- return_VALUE(0);
+ return 0;
}
int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
@@ -167,12 +165,10 @@ static int acpi_processor_get_performanc
union acpi_object *pct = NULL;
union acpi_object obj = { 0 };
- ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control");
-
status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
pct = (union acpi_object *)buffer.pointer;
@@ -219,7 +215,7 @@ static int acpi_processor_get_performanc
end:
acpi_os_free(buffer.pointer);
- return_VALUE(result);
+ return result;
}
static int acpi_processor_get_performance_states(struct acpi_processor *pr)
@@ -232,12 +228,10 @@ static int acpi_processor_get_performanc
union acpi_object *pss = NULL;
int i;
- ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states");
-
status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
pss = (union acpi_object *)buffer.pointer;
@@ -298,7 +292,7 @@ static int acpi_processor_get_performanc
end:
acpi_os_free(buffer.pointer);
- return_VALUE(result);
+ return result;
}
static int acpi_processor_get_performance_info(struct acpi_processor *pr)
@@ -307,31 +301,29 @@ static int acpi_processor_get_performanc
acpi_status status = AE_OK;
acpi_handle handle = NULL;
- ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info");
-
if (!pr || !pr->performance || !pr->handle)
- return_VALUE(-EINVAL);
+ return -EINVAL;
status = acpi_get_handle(pr->handle, "_PCT", &handle);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"ACPI-based processor performance control unavailable\n"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
result = acpi_processor_get_performance_control(pr);
if (result)
- return_VALUE(result);
+ return result;
result = acpi_processor_get_performance_states(pr);
if (result)
- return_VALUE(result);
+ return result;
result = acpi_processor_get_platform_limit(pr);
if (result)
- return_VALUE(result);
+ return result;
- return_VALUE(0);
+ return 0;
}
int acpi_processor_notify_smm(struct module *calling_module)
@@ -339,13 +331,11 @@ int acpi_processor_notify_smm(struct mod
acpi_status status;
static int is_done = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_notify_smm");
-
if (!(acpi_processor_ppc_status & PPC_REGISTERED))
- return_VALUE(-EBUSY);
+ return -EBUSY;
if (!try_module_get(calling_module))
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* is_done is set to negative if an error occured,
* and to postitive if _no_ error occured, but SMM
@@ -354,10 +344,10 @@ int acpi_processor_notify_smm(struct mod
*/
if (is_done > 0) {
module_put(calling_module);
- return_VALUE(0);
+ return 0;
} else if (is_done < 0) {
module_put(calling_module);
- return_VALUE(is_done);
+ return is_done;
}
is_done = -EIO;
@@ -366,7 +356,7 @@ int acpi_processor_notify_smm(struct mod
if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_cnt\n"));
module_put(calling_module);
- return_VALUE(0);
+ return 0;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -388,7 +378,7 @@ int acpi_processor_notify_smm(struct mod
"smi_cmd [0x%x]", acpi_fadt.pstate_cnt,
acpi_fadt.smi_cmd));
module_put(calling_module);
- return_VALUE(status);
+ return status;
}
/* Success. If there's no _PPC, we need to fear nothing, so
@@ -398,7 +388,7 @@ int acpi_processor_notify_smm(struct mod
if (!(acpi_processor_ppc_status & PPC_IN_USE))
module_put(calling_module);
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_processor_notify_smm);
@@ -419,8 +409,6 @@ static int acpi_processor_perf_seq_show(
struct acpi_processor *pr = (struct acpi_processor *)seq->private;
int i;
- ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show");
-
if (!pr)
goto end;
@@ -443,7 +431,7 @@ static int acpi_processor_perf_seq_show(
(u32) pr->performance->states[i].transition_latency);
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
@@ -465,23 +453,21 @@ acpi_processor_write_performance(struct
unsigned int new_state = 0;
struct cpufreq_policy policy;
- ACPI_FUNCTION_TRACE("acpi_processor_write_performance");
-
if (!pr || (count > sizeof(state_string) - 1))
- return_VALUE(-EINVAL);
+ return -EINVAL;
perf = pr->performance;
if (!perf)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (copy_from_user(state_string, buffer, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
state_string[count] = '\0';
new_state = simple_strtoul(state_string, NULL, 0);
if (new_state >= perf->state_count)
- return_VALUE(-EINVAL);
+ return -EINVAL;
cpufreq_get_policy(&policy, pr->id);
@@ -491,9 +477,9 @@ acpi_processor_write_performance(struct
result = cpufreq_set_policy(&policy);
if (result)
- return_VALUE(result);
+ return result;
- return_VALUE(count);
+ return count;
}
static void acpi_cpufreq_add_file(struct acpi_processor *pr)
@@ -501,10 +487,8 @@ static void acpi_cpufreq_add_file(struct
struct proc_dir_entry *entry = NULL;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
-
if (acpi_bus_get_device(pr->handle, &device))
- return_VOID;
+ return;
/* add file 'performance' [R/W] */
entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
@@ -516,23 +500,19 @@ static void acpi_cpufreq_add_file(struct
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
- return_VOID;
}
static void acpi_cpufreq_remove_file(struct acpi_processor *pr)
{
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
-
if (acpi_bus_get_device(pr->handle, &device))
- return_VOID;
+ return;
/* remove file 'performance' */
remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
acpi_device_dir(device));
- return_VOID;
}
#else
@@ -556,11 +536,9 @@ static int acpi_processor_get_psd(struct
union acpi_object *psd = NULL;
struct acpi_psd_package *pdomain;
- ACPI_FUNCTION_TRACE("acpi_processor_get_psd");
-
status = acpi_evaluate_object(pr->handle, "_PSD", NULL, &buffer);
if (ACPI_FAILURE(status)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
psd = (union acpi_object *) buffer.pointer;
@@ -603,7 +581,7 @@ static int acpi_processor_get_psd(struct
end:
acpi_os_free(buffer.pointer);
- return_VALUE(result);
+ return result;
}
int acpi_processor_preregister_performance(
@@ -618,8 +596,6 @@ int acpi_processor_preregister_performan
struct acpi_processor *match_pr;
struct acpi_psd_package *match_pdomain;
- ACPI_FUNCTION_TRACE("acpi_processor_preregister_performance");
-
down(&performance_sem);
retval = 0;
@@ -769,7 +745,7 @@ err_ret:
}
up(&performance_sem);
- return_VALUE(retval);
+ return retval;
}
EXPORT_SYMBOL(acpi_processor_preregister_performance);
@@ -780,22 +756,20 @@ acpi_processor_register_performance(stru
{
struct acpi_processor *pr;
- ACPI_FUNCTION_TRACE("acpi_processor_register_performance");
-
if (!(acpi_processor_ppc_status & PPC_REGISTERED))
- return_VALUE(-EINVAL);
+ return -EINVAL;
down(&performance_sem);
pr = processors[cpu];
if (!pr) {
up(&performance_sem);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
if (pr->performance) {
up(&performance_sem);
- return_VALUE(-EBUSY);
+ return -EBUSY;
}
pr->performance = performance;
@@ -803,13 +777,13 @@ acpi_processor_register_performance(stru
if (acpi_processor_get_performance_info(pr)) {
pr->performance = NULL;
up(&performance_sem);
- return_VALUE(-EIO);
+ return -EIO;
}
acpi_cpufreq_add_file(pr);
up(&performance_sem);
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_processor_register_performance);
@@ -820,14 +794,12 @@ acpi_processor_unregister_performance(st
{
struct acpi_processor *pr;
- ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance");
-
down(&performance_sem);
pr = processors[cpu];
if (!pr) {
up(&performance_sem);
- return_VOID;
+ return;
}
kfree(pr->performance->states);
@@ -837,7 +809,6 @@ acpi_processor_unregister_performance(st
up(&performance_sem);
- return_VOID;
}
EXPORT_SYMBOL(acpi_processor_unregister_performance);
---
0.99.9.GIT
next prev parent reply other threads:[~2006-04-18 1:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-18 1:21 [PATCH 1/24] Remove unneeded debugging macros in drivers/acpi/ac.c mochel
2006-04-18 1:21 ` [PATCH 2/24] Remove unneeded debugging macros in drivers/acpi/acpi_memhotplug.c mochel
2006-04-18 1:21 ` [PATCH 3/24] Remove unneeded debugging macros in drivers/acpi/battery.c mochel
2006-04-18 1:21 ` [PATCH 4/24] Remove unneeded debugging macros in drivers/acpi/bus.c mochel
2006-04-18 1:21 ` [PATCH 5/24] Remove unneeded debugging macros in drivers/acpi/button.c mochel
2006-04-18 1:21 ` [PATCH 6/24] Remove unneeded debugging macros in drivers/acpi/container.c mochel
2006-04-18 1:21 ` [PATCH 7/24] Remove unneeded debugging macros in drivers/acpi/debug.c mochel
2006-04-18 1:21 ` [PATCH 8/24] Remove unneeded debugging macros in drivers/acpi/ec.c mochel
2006-04-18 1:21 ` [PATCH 9/24] Remove unneeded debugging macros in drivers/acpi/event.c mochel
2006-04-18 1:21 ` [PATCH 10/24] Remove unneeded debugging macros in drivers/acpi/fan.c mochel
2006-04-18 1:21 ` [PATCH 11/24] Remove unneeded debugging macros in drivers/acpi/hotkey.c mochel
2006-04-18 1:21 ` [PATCH 12/24] Remove unneeded debugging macros in drivers/acpi/motherboard.c mochel
2006-04-18 1:21 ` [PATCH 13/24] Remove unneeded debugging macros in drivers/acpi/pci_bind.c mochel
2006-04-18 1:21 ` [PATCH 14/24] Remove unneeded debugging macros in drivers/acpi/pci_irq.c mochel
2006-04-18 1:21 ` [PATCH 15/24] Remove unneeded debugging macros in drivers/acpi/pci_link.c mochel
2006-04-18 1:21 ` [PATCH 16/24] Remove unneeded debugging macros in drivers/acpi/pci_root.c mochel
2006-04-18 1:21 ` [PATCH 17/24] Remove unneeded debugging macros in drivers/acpi/power.c mochel
2006-04-18 1:21 ` [PATCH 18/24] Remove unneeded debugging macros in drivers/acpi/processor_core.c mochel
2006-04-18 1:21 ` [PATCH 19/24] Remove unneeded debugging macros in drivers/acpi/processor_idle.c mochel
2006-04-18 1:21 ` mochel [this message]
2006-04-18 1:21 ` [PATCH 21/24] Remove unneeded debugging macros in drivers/acpi/processor_thermal.c mochel
2006-04-18 1:21 ` [PATCH 22/24] Remove unneeded debugging macros in drivers/acpi/processor_throttling.c mochel
2006-04-18 1:21 ` [PATCH 23/24] Remove unneeded debugging macros in drivers/acpi/system.c mochel
2006-04-18 1:21 ` [PATCH 24/24] Remove unneeded debugging macros in drivers/acpi/thermal.c mochel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11453233154124-git-send-email-mochel@linux.intel.com \
--to=mochel@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.