* [PATCH 1/24] Remove unneeded debugging macros in drivers/acpi/ac.c
@ 2006-04-18 1:21 mochel
2006-04-18 1:21 ` [PATCH 2/24] Remove unneeded debugging macros in drivers/acpi/acpi_memhotplug.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/ac.c | 60 ++++++++++++++++++-----------------------------------
1 files changed, 20 insertions(+), 40 deletions(-)
applies-to: c4356ddca2663c11808302198bce89da48a6b675
380d7c94d935cbee91ece702b7ad60247e565d89
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 95223d8..1d2cf05 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -84,19 +84,17 @@ static int acpi_ac_get_state(struct acpi
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("acpi_ac_get_state");
-
if (!ac)
- return_VALUE(-EINVAL);
+ return -EINVAL;
status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
ac->state = ACPI_AC_STATUS_UNKNOWN;
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -109,14 +107,12 @@ static int acpi_ac_seq_show(struct seq_f
{
struct acpi_ac *ac = (struct acpi_ac *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
-
if (!ac)
- return_VALUE(0);
+ return 0;
if (acpi_ac_get_state(ac)) {
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
- return_VALUE(0);
+ return 0;
}
seq_puts(seq, "state: ");
@@ -132,7 +128,7 @@ static int acpi_ac_seq_show(struct seq_f
break;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_ac_open_fs(struct inode *inode, struct file *file)
@@ -144,13 +140,11 @@ static int acpi_ac_add_fs(struct acpi_de
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_ac_add_fs");
-
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_ac_dir);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE;
}
@@ -158,20 +152,18 @@ static int acpi_ac_add_fs(struct acpi_de
entry = create_proc_entry(ACPI_AC_FILE_STATE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_ac_fops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_ac_remove_fs(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
-
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
@@ -179,7 +171,7 @@ static int acpi_ac_remove_fs(struct acpi
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -191,13 +183,11 @@ static void acpi_ac_notify(acpi_handle h
struct acpi_ac *ac = (struct acpi_ac *)data;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_ac_notify");
-
if (!ac)
- return_VOID;
+ return;
if (acpi_bus_get_device(ac->handle, &device))
- return_VOID;
+ return;
switch (event) {
case ACPI_AC_NOTIFY_STATUS:
@@ -210,7 +200,6 @@ static void acpi_ac_notify(acpi_handle h
break;
}
- return_VOID;
}
static int acpi_ac_add(struct acpi_device *device)
@@ -219,14 +208,12 @@ static int acpi_ac_add(struct acpi_devic
acpi_status status = AE_OK;
struct acpi_ac *ac = NULL;
- ACPI_FUNCTION_TRACE("acpi_ac_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
if (!ac)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(ac, 0, sizeof(struct acpi_ac));
ac->handle = device->handle;
@@ -260,7 +247,7 @@ static int acpi_ac_add(struct acpi_devic
kfree(ac);
}
- return_VALUE(result);
+ return result;
}
static int acpi_ac_remove(struct acpi_device *device, int type)
@@ -268,10 +255,8 @@ static int acpi_ac_remove(struct acpi_de
acpi_status status = AE_OK;
struct acpi_ac *ac = NULL;
- ACPI_FUNCTION_TRACE("acpi_ac_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
ac = (struct acpi_ac *)acpi_driver_data(device);
@@ -282,38 +267,33 @@ static int acpi_ac_remove(struct acpi_de
kfree(ac);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_ac_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_ac_init");
-
acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
if (!acpi_ac_dir)
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_ac_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_ac_driver);
if (result < 0) {
remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_ac_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_ac_exit");
-
acpi_bus_unregister_driver(&acpi_ac_driver);
remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
- return_VOID;
}
module_init(acpi_ac_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 2/24] Remove unneeded debugging macros in drivers/acpi/acpi_memhotplug.c
2006-04-18 1:21 [PATCH 1/24] Remove unneeded debugging macros in drivers/acpi/ac.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 3/24] Remove unneeded debugging macros in drivers/acpi/battery.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/acpi_memhotplug.c | 94 ++++++++++++++--------------------------
1 files changed, 32 insertions(+), 62 deletions(-)
applies-to: f9df1b6ca25f80dc2ddb21f1f1deff1147a33789
8a1cb494eab655073133b2dbc5c25880f97b49b3
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index e49d327..f43ddde 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -85,12 +85,10 @@ acpi_memory_get_device_resources(struct
struct acpi_resource *resource = NULL;
struct acpi_resource_address64 address64;
- ACPI_FUNCTION_TRACE("acpi_memory_get_device_resources");
-
/* Get the range from the _CRS */
status = acpi_get_current_resources(mem_device->handle, &buffer);
if (ACPI_FAILURE(status))
- return_VALUE(-EINVAL);
+ return -EINVAL;
resource = (struct acpi_resource *)buffer.pointer;
status = acpi_resource_to_address64(resource, &address64);
@@ -106,7 +104,7 @@ acpi_memory_get_device_resources(struct
}
acpi_os_free(buffer.pointer);
- return_VALUE(0);
+ return 0;
}
static int
@@ -118,22 +116,20 @@ acpi_memory_get_device(acpi_handle handl
struct acpi_device *device = NULL;
struct acpi_device *pdevice = NULL;
- ACPI_FUNCTION_TRACE("acpi_memory_get_device");
-
if (!acpi_bus_get_device(handle, &device) && device)
goto end;
status = acpi_get_parent(handle, &phandle);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
/* Get the parent device */
status = acpi_bus_get_device(phandle, &pdevice);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
/*
@@ -143,29 +139,27 @@ acpi_memory_get_device(acpi_handle handl
status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
end:
*mem_device = acpi_driver_data(device);
if (!(*mem_device)) {
printk(KERN_ERR "\n driver data not found");
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
{
unsigned long current_status;
- ACPI_FUNCTION_TRACE("acpi_memory_check_device");
-
/* Get device present/absent information from the _STA */
if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
NULL, ¤t_status)))
- return_VALUE(-ENODEV);
+ return -ENODEV;
/*
* Check for device status. Device should be
* present/enabled/functioning.
@@ -173,17 +167,15 @@ static int acpi_memory_check_device(stru
if (!((current_status & ACPI_MEMORY_STA_PRESENT)
&& (current_status & ACPI_MEMORY_STA_ENABLED)
&& (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
- return_VALUE(-ENODEV);
+ return -ENODEV;
- return_VALUE(0);
+ return 0;
}
static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
{
int result;
- ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
-
/* Get the range from the _CRS */
result = acpi_memory_get_device_resources(mem_device);
if (result) {
@@ -213,8 +205,6 @@ static int acpi_memory_powerdown_device(
union acpi_object arg;
unsigned long current_status;
- ACPI_FUNCTION_TRACE("acpi_memory_powerdown_device");
-
/* Issue the _EJ0 command */
arg_list.count = 1;
arg_list.pointer = &arg;
@@ -225,20 +215,20 @@ static int acpi_memory_powerdown_device(
/* Return on _EJ0 failure */
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
/* Evalute _STA to check if the device is disabled */
status = acpi_evaluate_integer(mem_device->handle, "_STA",
NULL, ¤t_status);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
/* Check for device status. Device should be disabled */
if (current_status & ACPI_MEMORY_STA_ENABLED)
- return_VALUE(-EINVAL);
+ return -EINVAL;
- return_VALUE(0);
+ return 0;
}
static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
@@ -247,15 +237,13 @@ static int acpi_memory_disable_device(st
u64 start = mem_device->start_addr;
u64 len = mem_device->length;
- ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
-
/*
* Ask the VM to offline this memory range.
* Note: Assume that this function returns zero on success
*/
result = remove_memory(start, len);
if (result)
- return_VALUE(result);
+ return result;
/* Power-off and eject the device */
result = acpi_memory_powerdown_device(mem_device);
@@ -274,8 +262,6 @@ static void acpi_memory_device_notify(ac
struct acpi_memory_device *mem_device;
struct acpi_device *device;
- ACPI_FUNCTION_TRACE("acpi_memory_device_notify");
-
switch (event) {
case ACPI_NOTIFY_BUS_CHECK:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -287,7 +273,7 @@ static void acpi_memory_device_notify(ac
"\nReceived DEVICE CHECK notification for device\n"));
if (acpi_memory_get_device(handle, &mem_device)) {
ACPI_ERROR((AE_INFO, "Cannot find driver data"));
- return_VOID;
+ return;
}
if (!acpi_memory_check_device(mem_device)) {
@@ -329,7 +315,6 @@ static void acpi_memory_device_notify(ac
break;
}
- return_VOID;
}
static int acpi_memory_device_add(struct acpi_device *device)
@@ -337,14 +322,12 @@ static int acpi_memory_device_add(struct
int result;
struct acpi_memory_device *mem_device = NULL;
- ACPI_FUNCTION_TRACE("acpi_memory_device_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
if (!mem_device)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(mem_device, 0, sizeof(struct acpi_memory_device));
mem_device->handle = device->handle;
@@ -356,7 +339,7 @@ static int acpi_memory_device_add(struct
result = acpi_memory_get_device_resources(mem_device);
if (result) {
kfree(mem_device);
- return_VALUE(result);
+ return result;
}
/* Set the device state */
@@ -364,22 +347,20 @@ static int acpi_memory_device_add(struct
printk(KERN_INFO "%s \n", acpi_device_name(device));
- return_VALUE(result);
+ return result;
}
static int acpi_memory_device_remove(struct acpi_device *device, int type)
{
struct acpi_memory_device *mem_device = NULL;
- ACPI_FUNCTION_TRACE("acpi_memory_device_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
kfree(mem_device);
- return_VALUE(0);
+ return 0;
}
/*
@@ -392,16 +373,14 @@ static acpi_status is_memory_device(acpi
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_device_info *info;
- ACPI_FUNCTION_TRACE("is_memory_device");
-
status = acpi_get_object_info(handle, &buffer);
if (ACPI_FAILURE(status))
- return_ACPI_STATUS(status);
+ return status;
info = buffer.pointer;
if (!(info->valid & ACPI_VALID_HID)) {
acpi_os_free(buffer.pointer);
- return_ACPI_STATUS(AE_ERROR);
+ return AE_ERROR;
}
hardware_id = info->hardware_id.value;
@@ -410,7 +389,7 @@ static acpi_status is_memory_device(acpi
status = AE_ERROR;
acpi_os_free(buffer.pointer);
- return_ACPI_STATUS(status);
+ return status;
}
static acpi_status
@@ -419,18 +398,16 @@ acpi_memory_register_notify_handler(acpi
{
acpi_status status;
- ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler");
-
status = is_memory_device(handle);
if (ACPI_FAILURE(status)){
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
- return_ACPI_STATUS(AE_OK); /* continue */
+ return AE_OK; /* continue */
}
status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify, NULL);
/* continue */
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
static acpi_status
@@ -439,19 +416,17 @@ acpi_memory_deregister_notify_handler(ac
{
acpi_status status;
- ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
-
status = is_memory_device(handle);
if (ACPI_FAILURE(status)){
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
- return_ACPI_STATUS(AE_OK); /* continue */
+ return AE_OK; /* continue */
}
status = acpi_remove_notify_handler(handle,
ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify);
- return_ACPI_STATUS(AE_OK); /* continue */
+ return AE_OK; /* continue */
}
static int __init acpi_memory_device_init(void)
@@ -459,12 +434,10 @@ static int __init acpi_memory_device_ini
int result;
acpi_status status;
- ACPI_FUNCTION_TRACE("acpi_memory_device_init");
-
result = acpi_bus_register_driver(&acpi_memory_device_driver);
if (result < 0)
- return_VALUE(-ENODEV);
+ return -ENODEV;
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
@@ -474,18 +447,16 @@ static int __init acpi_memory_device_ini
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
acpi_bus_unregister_driver(&acpi_memory_device_driver);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_memory_device_exit(void)
{
acpi_status status;
- ACPI_FUNCTION_TRACE("acpi_memory_device_exit");
-
/*
* Adding this to un-install notification handlers for all the device
* handles.
@@ -500,7 +471,6 @@ static void __exit acpi_memory_device_ex
acpi_bus_unregister_driver(&acpi_memory_device_driver);
- return_VOID;
}
module_init(acpi_memory_device_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 3/24] Remove unneeded debugging macros in drivers/acpi/battery.c
2006-04-18 1:21 ` [PATCH 2/24] Remove unneeded debugging macros in drivers/acpi/acpi_memhotplug.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 4/24] Remove unneeded debugging macros in drivers/acpi/bus.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/battery.c | 110 +++++++++++++++++-------------------------------
1 files changed, 39 insertions(+), 71 deletions(-)
applies-to: a6f9b1df27d3c3ea8da566f13c5dbd09e4785fa0
6e62e31ebb916529240a7a3a23fcd0f3c8836d0a
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 3b92c94..9df70f1 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -132,17 +132,15 @@ acpi_battery_get_info(struct acpi_batter
struct acpi_buffer data = { 0, NULL };
union acpi_object *package = NULL;
- ACPI_FUNCTION_TRACE("acpi_battery_get_info");
-
if (!battery || !bif)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* Evalute _BIF */
status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
package = (union acpi_object *)buffer.pointer;
@@ -177,7 +175,7 @@ acpi_battery_get_info(struct acpi_batter
if (!result)
(*bif) = (struct acpi_battery_info *)data.pointer;
- return_VALUE(result);
+ return result;
}
static int
@@ -193,17 +191,15 @@ acpi_battery_get_status(struct acpi_batt
struct acpi_buffer data = { 0, NULL };
union acpi_object *package = NULL;
- ACPI_FUNCTION_TRACE("acpi_battery_get_status");
-
if (!battery || !bst)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* Evalute _BST */
status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
package = (union acpi_object *)buffer.pointer;
@@ -238,7 +234,7 @@ acpi_battery_get_status(struct acpi_batt
if (!result)
(*bst) = (struct acpi_battery_status *)data.pointer;
- return_VALUE(result);
+ return result;
}
static int
@@ -248,25 +244,23 @@ acpi_battery_set_alarm(struct acpi_batte
union acpi_object arg0 = { ACPI_TYPE_INTEGER };
struct acpi_object_list arg_list = { 1, &arg0 };
- ACPI_FUNCTION_TRACE("acpi_battery_set_alarm");
-
if (!battery)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!battery->flags.alarm)
- return_VALUE(-ENODEV);
+ return -ENODEV;
arg0.integer.value = alarm;
status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm));
battery->alarm = alarm;
- return_VALUE(0);
+ return 0;
}
static int acpi_battery_check(struct acpi_battery *battery)
@@ -277,18 +271,16 @@ static int acpi_battery_check(struct acp
struct acpi_device *device = NULL;
struct acpi_battery_info *bif = NULL;
- ACPI_FUNCTION_TRACE("acpi_battery_check");
-
if (!battery)
- return_VALUE(-EINVAL);
+ return -EINVAL;
result = acpi_bus_get_device(battery->handle, &device);
if (result)
- return_VALUE(result);
+ return result;
result = acpi_bus_get_status(device);
if (result)
- return_VALUE(result);
+ return result;
/* Insertion? */
@@ -300,7 +292,7 @@ static int acpi_battery_check(struct acp
result = acpi_battery_get_info(battery, &bif);
if (result)
- return_VALUE(result);
+ return result;
battery->flags.power_unit = bif->power_unit;
battery->trips.warning = bif->design_capacity_warning;
@@ -324,7 +316,7 @@ static int acpi_battery_check(struct acp
battery->flags.present = device->status.battery_present;
- return_VALUE(result);
+ return result;
}
/* --------------------------------------------------------------------------
@@ -339,8 +331,6 @@ static int acpi_battery_read_info(struct
struct acpi_battery_info *bif = NULL;
char *units = "?";
- ACPI_FUNCTION_TRACE("acpi_battery_read_info");
-
if (!battery)
goto end;
@@ -409,7 +399,7 @@ static int acpi_battery_read_info(struct
end:
kfree(bif);
- return_VALUE(0);
+ return 0;
}
static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
@@ -424,8 +414,6 @@ static int acpi_battery_read_state(struc
struct acpi_battery_status *bst = NULL;
char *units = "?";
- ACPI_FUNCTION_TRACE("acpi_battery_read_state");
-
if (!battery)
goto end;
@@ -487,7 +475,7 @@ static int acpi_battery_read_state(struc
end:
kfree(bst);
- return_VALUE(0);
+ return 0;
}
static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
@@ -500,8 +488,6 @@ static int acpi_battery_read_alarm(struc
struct acpi_battery *battery = (struct acpi_battery *)seq->private;
char *units = "?";
- ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
-
if (!battery)
goto end;
@@ -525,7 +511,7 @@ static int acpi_battery_read_alarm(struc
seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units);
end:
- return_VALUE(0);
+ return 0;
}
static ssize_t
@@ -538,25 +524,23 @@ acpi_battery_write_alarm(struct file *fi
struct seq_file *m = (struct seq_file *)file->private_data;
struct acpi_battery *battery = (struct acpi_battery *)m->private;
- ACPI_FUNCTION_TRACE("acpi_battery_write_alarm");
-
if (!battery || (count > sizeof(alarm_string) - 1))
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!battery->flags.present)
- return_VALUE(-ENODEV);
+ return -ENODEV;
if (copy_from_user(alarm_string, buffer, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
alarm_string[count] = '\0';
result = acpi_battery_set_alarm(battery,
simple_strtoul(alarm_string, NULL, 0));
if (result)
- return_VALUE(result);
+ return result;
- return_VALUE(count);
+ return count;
}
static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
@@ -593,13 +577,11 @@ static int acpi_battery_add_fs(struct ac
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_battery_add_fs");
-
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_battery_dir);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE;
}
@@ -607,7 +589,7 @@ static int acpi_battery_add_fs(struct ac
entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_battery_info_ops;
entry->data = acpi_driver_data(device);
@@ -618,7 +600,7 @@ static int acpi_battery_add_fs(struct ac
entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_battery_state_ops;
entry->data = acpi_driver_data(device);
@@ -630,20 +612,18 @@ static int acpi_battery_add_fs(struct ac
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_battery_alarm_ops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_battery_remove_fs(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
-
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_BATTERY_FILE_ALARM,
acpi_device_dir(device));
@@ -656,7 +636,7 @@ static int acpi_battery_remove_fs(struct
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -668,13 +648,11 @@ static void acpi_battery_notify(acpi_han
struct acpi_battery *battery = (struct acpi_battery *)data;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_battery_notify");
-
if (!battery)
- return_VOID;
+ return;
if (acpi_bus_get_device(handle, &device))
- return_VOID;
+ return;
switch (event) {
case ACPI_BATTERY_NOTIFY_STATUS:
@@ -688,7 +666,6 @@ static void acpi_battery_notify(acpi_han
break;
}
- return_VOID;
}
static int acpi_battery_add(struct acpi_device *device)
@@ -697,14 +674,12 @@ static int acpi_battery_add(struct acpi_
acpi_status status = 0;
struct acpi_battery *battery = NULL;
- ACPI_FUNCTION_TRACE("acpi_battery_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL);
if (!battery)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(battery, 0, sizeof(struct acpi_battery));
battery->handle = device->handle;
@@ -738,7 +713,7 @@ static int acpi_battery_add(struct acpi_
kfree(battery);
}
- return_VALUE(result);
+ return result;
}
static int acpi_battery_remove(struct acpi_device *device, int type)
@@ -746,10 +721,8 @@ static int acpi_battery_remove(struct ac
acpi_status status = 0;
struct acpi_battery *battery = NULL;
- ACPI_FUNCTION_TRACE("acpi_battery_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
battery = (struct acpi_battery *)acpi_driver_data(device);
@@ -761,38 +734,33 @@ static int acpi_battery_remove(struct ac
kfree(battery);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_battery_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_battery_init");
-
acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
if (!acpi_battery_dir)
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_battery_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_battery_driver);
if (result < 0) {
remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_battery_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_battery_exit");
-
acpi_bus_unregister_driver(&acpi_battery_driver);
remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
- return_VOID;
}
module_init(acpi_battery_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 4/24] Remove unneeded debugging macros in drivers/acpi/bus.c
2006-04-18 1:21 ` [PATCH 3/24] Remove unneeded debugging macros in drivers/acpi/battery.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 5/24] Remove unneeded debugging macros in drivers/acpi/button.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/bus.c | 115 +++++++++++++++++++---------------------------------
1 files changed, 43 insertions(+), 72 deletions(-)
applies-to: d6feb0bf3c33e3c8b465b7ff6f5c515b0da5bb37
fcd1437241f3799f37ea16c9c37c415ff1b94781
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index bb7c4cb..ffee3ae 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -60,20 +60,18 @@ int acpi_bus_get_device(acpi_handle hand
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("acpi_bus_get_device");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* TBD: Support fixed-feature devices */
status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
if (ACPI_FAILURE(status) || !*device) {
ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_bus_get_device);
@@ -83,10 +81,8 @@ int acpi_bus_get_status(struct acpi_devi
acpi_status status = AE_OK;
unsigned long sta = 0;
- ACPI_FUNCTION_TRACE("acpi_bus_get_status");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/*
* Evaluate _STA if present.
@@ -95,7 +91,7 @@ int acpi_bus_get_status(struct acpi_devi
status =
acpi_evaluate_integer(device->handle, "_STA", NULL, &sta);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
STRUCT_TO_INT(device->status) = (int)sta;
}
@@ -119,7 +115,7 @@ int acpi_bus_get_status(struct acpi_devi
device->pnp.bus_id,
(u32) STRUCT_TO_INT(device->status)));
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_bus_get_status);
@@ -135,11 +131,9 @@ int acpi_bus_get_power(acpi_handle handl
struct acpi_device *device = NULL;
unsigned long psc = 0;
- ACPI_FUNCTION_TRACE("acpi_bus_get_power");
-
result = acpi_bus_get_device(handle, &device);
if (result)
- return_VALUE(result);
+ return result;
*state = ACPI_STATE_UNKNOWN;
@@ -158,12 +152,12 @@ int acpi_bus_get_power(acpi_handle handl
status = acpi_evaluate_integer(device->handle, "_PSC",
NULL, &psc);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
device->power.state = (int)psc;
} else if (device->power.flags.power_resources) {
result = acpi_power_get_inferred_state(device);
if (result)
- return_VALUE(result);
+ return result;
}
*state = device->power.state;
@@ -172,7 +166,7 @@ int acpi_bus_get_power(acpi_handle handl
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n",
device->pnp.bus_id, device->power.state));
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_bus_get_power);
@@ -184,20 +178,18 @@ int acpi_bus_set_power(acpi_handle handl
struct acpi_device *device = NULL;
char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' };
- ACPI_FUNCTION_TRACE("acpi_bus_set_power");
-
result = acpi_bus_get_device(handle, &device);
if (result)
- return_VALUE(result);
+ return result;
if ((state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* Make sure this is a valid target state */
if (!device->flags.power_manageable) {
ACPI_INFO((AE_INFO, "Device is not power manageable"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
/*
* Get device's current power state if it's unknown
@@ -208,17 +200,17 @@ int acpi_bus_set_power(acpi_handle handl
if (state == device->power.state) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
state));
- return_VALUE(0);
+ return 0;
}
if (!device->power.states[state].flags.valid) {
ACPI_WARNING((AE_INFO, "Device does not support D%d", state));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
if (device->parent && (state < device->parent->power.state)) {
ACPI_WARNING((AE_INFO,
"Cannot set device to a higher-powered"
" state than parent"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
/*
@@ -268,7 +260,7 @@ int acpi_bus_set_power(acpi_handle handl
"Device [%s] transitioned to D%d\n",
device->pnp.bus_id, state));
- return_VALUE(result);
+ return result;
}
EXPORT_SYMBOL(acpi_bus_set_power);
@@ -289,18 +281,16 @@ int acpi_bus_generate_event(struct acpi_
struct acpi_bus_event *event = NULL;
unsigned long flags = 0;
- ACPI_FUNCTION_TRACE("acpi_bus_generate_event");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* drop event on the floor if no one's listening */
if (!event_is_open)
- return_VALUE(0);
+ return 0;
event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
if (!event)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
strcpy(event->device_class, device->pnp.device_class);
strcpy(event->bus_id, device->pnp.bus_id);
@@ -313,7 +303,7 @@ int acpi_bus_generate_event(struct acpi_
wake_up_interruptible(&acpi_bus_event_queue);
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_bus_generate_event);
@@ -325,10 +315,8 @@ int acpi_bus_receive_event(struct acpi_b
DECLARE_WAITQUEUE(wait, current);
- ACPI_FUNCTION_TRACE("acpi_bus_receive_event");
-
if (!event)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (list_empty(&acpi_bus_event_list)) {
@@ -342,7 +330,7 @@ int acpi_bus_receive_event(struct acpi_b
set_current_state(TASK_RUNNING);
if (signal_pending(current))
- return_VALUE(-ERESTARTSYS);
+ return -ERESTARTSYS;
}
spin_lock_irqsave(&acpi_bus_event_lock, flags);
@@ -353,13 +341,13 @@ int acpi_bus_receive_event(struct acpi_b
spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
memcpy(event, entry, sizeof(struct acpi_bus_event));
kfree(entry);
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_bus_receive_event);
@@ -374,10 +362,8 @@ acpi_bus_check_device(struct acpi_device
acpi_status status = 0;
struct acpi_device_status old_status;
- ACPI_FUNCTION_TRACE("acpi_bus_check_device");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (status_changed)
*status_changed = 0;
@@ -394,15 +380,15 @@ acpi_bus_check_device(struct acpi_device
if (status_changed)
*status_changed = 1;
}
- return_VALUE(0);
+ return 0;
}
status = acpi_bus_get_status(device);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status))
- return_VALUE(0);
+ return 0;
if (status_changed)
*status_changed = 1;
@@ -418,7 +404,7 @@ acpi_bus_check_device(struct acpi_device
/* TBD: Handle device removal */
}
- return_VALUE(0);
+ return 0;
}
static int acpi_bus_check_scope(struct acpi_device *device)
@@ -426,25 +412,23 @@ static int acpi_bus_check_scope(struct a
int result = 0;
int status_changed = 0;
- ACPI_FUNCTION_TRACE("acpi_bus_check_scope");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* Status Change? */
result = acpi_bus_check_device(device, &status_changed);
if (result)
- return_VALUE(result);
+ return result;
if (!status_changed)
- return_VALUE(0);
+ return 0;
/*
* TBD: Enumerate child devices within this device's scope and
* run acpi_bus_check_device()'s on them.
*/
- return_VALUE(0);
+ return 0;
}
/**
@@ -457,10 +441,8 @@ static void acpi_bus_notify(acpi_handle
int result = 0;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_bus_notify");
-
if (acpi_bus_get_device(handle, &device))
- return_VOID;
+ return;
switch (type) {
@@ -535,7 +517,6 @@ static void acpi_bus_notify(acpi_handle
break;
}
- return_VOID;
}
/* --------------------------------------------------------------------------
@@ -549,8 +530,6 @@ static int __init acpi_bus_init_irq(void
struct acpi_object_list arg_list = { 1, &arg };
char *message = NULL;
- ACPI_FUNCTION_TRACE("acpi_bus_init_irq");
-
/*
* Let the system know what interrupt model we are using by
* evaluating the \_PIC object, if exists.
@@ -568,7 +547,7 @@ static int __init acpi_bus_init_irq(void
break;
default:
printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n");
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message);
@@ -578,10 +557,10 @@ static int __init acpi_bus_init_irq(void
status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL);
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
void __init acpi_early_init(void)
@@ -589,10 +568,8 @@ void __init acpi_early_init(void)
acpi_status status = AE_OK;
struct acpi_buffer buffer = { sizeof(acpi_fadt), &acpi_fadt };
- ACPI_FUNCTION_TRACE("acpi_early_init");
-
if (acpi_disabled)
- return_VOID;
+ return;
/* enable workarounds, unless strict ACPI spec. compliance */
if (!acpi_strict)
@@ -650,11 +627,9 @@ void __init acpi_early_init(void)
goto error0;
}
- return_VOID;
error0:
disable_acpi();
- return_VOID;
}
static int __init acpi_bus_init(void)
@@ -663,8 +638,6 @@ static int __init acpi_bus_init(void)
acpi_status status = AE_OK;
extern acpi_status acpi_os_initialize1(void);
- ACPI_FUNCTION_TRACE("acpi_bus_init");
-
status = acpi_os_initialize1();
status =
@@ -725,12 +698,12 @@ static int __init acpi_bus_init(void)
*/
acpi_root_dir = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL);
- return_VALUE(0);
+ return 0;
/* Mimic structured exception handling */
error1:
acpi_terminate();
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
decl_subsys(acpi, NULL, NULL);
@@ -739,13 +712,11 @@ static int __init acpi_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_init");
-
printk(KERN_INFO PREFIX "Subsystem revision %08x\n", ACPI_CA_VERSION);
if (acpi_disabled) {
printk(KERN_INFO PREFIX "Interpreter disabled.\n");
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
firmware_register(&acpi_subsys);
@@ -766,7 +737,7 @@ static int __init acpi_init(void)
} else
disable_acpi();
- return_VALUE(result);
+ return result;
}
subsys_initcall(acpi_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 6/24] Remove unneeded debugging macros in drivers/acpi/container.c
2006-04-18 1:21 ` [PATCH 5/24] Remove unneeded debugging macros in drivers/acpi/button.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 7/24] Remove unneeded debugging macros in drivers/acpi/debug.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/container.c | 38 ++++++++++++--------------------------
1 files changed, 12 insertions(+), 26 deletions(-)
applies-to: 73d9b0c49efb5a10ba623dadd70e60b2b2b78e7b
8aa5c2456d03e6bcdc829259e69f36e2977fcd06
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 53625fc..f6fe32a 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -73,17 +73,15 @@ static int is_device_present(acpi_handle
acpi_status status;
unsigned long sta;
- ACPI_FUNCTION_TRACE("is_device_present");
-
status = acpi_get_handle(handle, "_STA", &temp);
if (ACPI_FAILURE(status))
- return_VALUE(1); /* _STA not found, assmue device present */
+ return 1; /* _STA not found, assmue device present */
status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
if (ACPI_FAILURE(status))
- return_VALUE(0); /* Firmware error */
+ return 0; /* Firmware error */
- return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
+ return (sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT;
}
/*******************************************************************/
@@ -91,16 +89,14 @@ static int acpi_container_add(struct acp
{
struct acpi_container *container;
- ACPI_FUNCTION_TRACE("acpi_container_add");
-
if (!device) {
ACPI_ERROR((AE_INFO, "device is NULL"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
if (!container)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(container, 0, sizeof(struct acpi_container));
container->handle = device->handle;
@@ -111,7 +107,7 @@ static int acpi_container_add(struct acp
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",
acpi_device_name(device), acpi_device_bid(device)));
- return_VALUE(0);
+ return 0;
}
static int acpi_container_remove(struct acpi_device *device, int type)
@@ -130,23 +126,21 @@ static int container_device_add(struct a
struct acpi_device *pdev;
int result;
- ACPI_FUNCTION_TRACE("container_device_add");
-
if (acpi_get_parent(handle, &phandle)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
if (acpi_bus_get_device(phandle, &pdev)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
result = acpi_bus_start(*device);
- return_VALUE(result);
+ return result;
}
static void container_notify_cb(acpi_handle handle, u32 type, void *context)
@@ -156,8 +150,6 @@ static void container_notify_cb(acpi_han
int present;
acpi_status status;
- ACPI_FUNCTION_TRACE("container_notify_cb");
-
present = is_device_present(handle);
switch (type) {
@@ -192,7 +184,6 @@ static void container_notify_cb(acpi_han
default:
break;
}
- return_VOID;
}
static acpi_status
@@ -205,11 +196,9 @@ container_walk_namespace_cb(acpi_handle
acpi_status status;
int *action = context;
- ACPI_FUNCTION_TRACE("container_walk_namespace_cb");
-
status = acpi_get_object_info(handle, &buffer);
if (ACPI_FAILURE(status) || !buffer.pointer) {
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
info = buffer.pointer;
@@ -243,7 +232,7 @@ container_walk_namespace_cb(acpi_handle
end:
acpi_os_free(buffer.pointer);
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
static int __init acpi_container_init(void)
@@ -269,8 +258,6 @@ static void __exit acpi_container_exit(v
{
int action = UNINSTALL_NOTIFY_HANDLER;
- ACPI_FUNCTION_TRACE("acpi_container_exit");
-
acpi_walk_namespace(ACPI_TYPE_DEVICE,
ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
@@ -278,7 +265,6 @@ static void __exit acpi_container_exit(v
acpi_bus_unregister_driver(&acpi_container_driver);
- return_VOID;
}
module_init(acpi_container_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 9/24] Remove unneeded debugging macros in drivers/acpi/event.c
2006-04-18 1:21 ` [PATCH 8/24] Remove unneeded debugging macros in drivers/acpi/ec.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 10/24] Remove unneeded debugging macros in drivers/acpi/fan.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/event.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
applies-to: 65fc0b6d7275eddc21b21841c1d3f896d5972a58
d16be8d5640de1b382b085bbd2d19678ec7619b5
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index dab09d3..ed27d8e 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -48,18 +48,16 @@ acpi_system_read_event(struct file *file
static int chars_remaining = 0;
static char *ptr;
- ACPI_FUNCTION_TRACE("acpi_system_read_event");
-
if (!chars_remaining) {
memset(&event, 0, sizeof(struct acpi_bus_event));
if ((file->f_flags & O_NONBLOCK)
&& (list_empty(&acpi_bus_event_list)))
- return_VALUE(-EAGAIN);
+ return -EAGAIN;
result = acpi_bus_receive_event(&event);
if (result)
- return_VALUE(result);
+ return result;
chars_remaining = sprintf(str, "%s %s %08x %08x\n",
event.device_class ? event.
@@ -75,13 +73,13 @@ acpi_system_read_event(struct file *file
}
if (copy_to_user(buffer, ptr, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
*ppos += count;
chars_remaining -= count;
ptr += count;
- return_VALUE(count);
+ return count;
}
static int acpi_system_close_event(struct inode *inode, struct file *file)
@@ -112,10 +110,8 @@ static int __init acpi_event_init(void)
struct proc_dir_entry *entry;
int error = 0;
- ACPI_FUNCTION_TRACE("acpi_event_init");
-
if (acpi_disabled)
- return_VALUE(0);
+ return 0;
/* 'event' [R] */
entry = create_proc_entry("event", S_IRUSR, acpi_root_dir);
@@ -124,7 +120,7 @@ static int __init acpi_event_init(void)
else {
error = -ENODEV;
}
- return_VALUE(error);
+ return error;
}
subsys_initcall(acpi_event_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 7/24] Remove unneeded debugging macros in drivers/acpi/debug.c
2006-04-18 1:21 ` [PATCH 6/24] Remove unneeded debugging macros in drivers/acpi/container.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 8/24] Remove unneeded debugging macros in drivers/acpi/ec.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/debug.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
applies-to: ce1874742f9967d719f89401e5c88209764ef1cd
fc3c173fd00ce05df840fad89b2344436058e4a3
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
index ec7bcee..2cd66c8 100644
--- a/drivers/acpi/debug.c
+++ b/drivers/acpi/debug.c
@@ -155,13 +155,11 @@ acpi_system_write_debug(struct file *fil
{
char debug_string[12] = { '\0' };
- ACPI_FUNCTION_TRACE("acpi_system_write_debug");
-
if (count > sizeof(debug_string) - 1)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (copy_from_user(debug_string, buffer, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
debug_string[count] = '\0';
@@ -173,10 +171,10 @@ acpi_system_write_debug(struct file *fil
acpi_dbg_level = simple_strtoul(debug_string, NULL, 0);
break;
default:
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
- return_VALUE(count);
+ return count;
}
static int __init acpi_debug_init(void)
@@ -185,10 +183,8 @@ static int __init acpi_debug_init(void)
int error = 0;
char *name;
- ACPI_FUNCTION_TRACE("acpi_debug_init");
-
if (acpi_disabled)
- return_VALUE(0);
+ return 0;
/* 'debug_layer' [R/W] */
name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
@@ -213,7 +209,7 @@ static int __init acpi_debug_init(void)
goto Error;
Done:
- return_VALUE(error);
+ return error;
Error:
remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 5/24] Remove unneeded debugging macros in drivers/acpi/button.c
2006-04-18 1:21 ` [PATCH 4/24] Remove unneeded debugging macros in drivers/acpi/bus.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 6/24] Remove unneeded debugging macros in drivers/acpi/container.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/button.c | 64 ++++++++++++++++---------------------------------
1 files changed, 21 insertions(+), 43 deletions(-)
applies-to: 8874c10f9ca6ee5536a19023aaca34509e89c46f
96969246acf5a176a7fa5916999b377ea4d3a31b
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index a8717da..edccc8b 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -112,15 +112,13 @@ static int acpi_button_info_seq_show(str
{
struct acpi_button *button = (struct acpi_button *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_button_info_seq_show");
-
if (!button || !button->device)
- return_VALUE(0);
+ return 0;
seq_printf(seq, "type: %s\n",
acpi_device_name(button->device));
- return_VALUE(0);
+ return 0;
}
static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
@@ -134,10 +132,8 @@ static int acpi_button_state_seq_show(st
acpi_status status;
unsigned long state;
- ACPI_FUNCTION_TRACE("acpi_button_state_seq_show");
-
if (!button || !button->device)
- return_VALUE(0);
+ return 0;
status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);
if (ACPI_FAILURE(status)) {
@@ -147,7 +143,7 @@ static int acpi_button_state_seq_show(st
(state ? "open" : "closed"));
}
- return_VALUE(0);
+ return 0;
}
static int acpi_button_state_open_fs(struct inode *inode, struct file *file)
@@ -164,10 +160,8 @@ static int acpi_button_add_fs(struct acp
struct proc_dir_entry *entry = NULL;
struct acpi_button *button = NULL;
- ACPI_FUNCTION_TRACE("acpi_button_add_fs");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
button = acpi_driver_data(device);
@@ -195,19 +189,19 @@ static int acpi_button_add_fs(struct acp
}
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
entry->owner = THIS_MODULE;
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE;
/* 'info' [R] */
entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_button_info_fops;
entry->data = acpi_driver_data(device);
@@ -227,15 +221,13 @@ static int acpi_button_add_fs(struct acp
}
}
- return_VALUE(0);
+ return 0;
}
static int acpi_button_remove_fs(struct acpi_device *device)
{
struct acpi_button *button = NULL;
- ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
-
button = acpi_driver_data(device);
if (acpi_device_dir(device)) {
if (button->type == ACPI_BUTTON_TYPE_LID)
@@ -249,7 +241,7 @@ static int acpi_button_remove_fs(struct
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -260,10 +252,8 @@ static void acpi_button_notify(acpi_hand
{
struct acpi_button *button = (struct acpi_button *)data;
- ACPI_FUNCTION_TRACE("acpi_button_notify");
-
if (!button || !button->device)
- return_VOID;
+ return;
switch (event) {
case ACPI_BUTTON_NOTIFY_STATUS:
@@ -276,21 +266,18 @@ static void acpi_button_notify(acpi_hand
break;
}
- return_VOID;
}
static acpi_status acpi_button_notify_fixed(void *data)
{
struct acpi_button *button = (struct acpi_button *)data;
- ACPI_FUNCTION_TRACE("acpi_button_notify_fixed");
-
if (!button)
- return_ACPI_STATUS(AE_BAD_PARAMETER);
+ return AE_BAD_PARAMETER;
acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
static int acpi_button_add(struct acpi_device *device)
@@ -299,14 +286,12 @@ static int acpi_button_add(struct acpi_d
acpi_status status = AE_OK;
struct acpi_button *button = NULL;
- ACPI_FUNCTION_TRACE("acpi_button_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL);
if (!button)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(button, 0, sizeof(struct acpi_button));
button->device = device;
@@ -400,7 +385,7 @@ static int acpi_button_add(struct acpi_d
kfree(button);
}
- return_VALUE(result);
+ return result;
}
static int acpi_button_remove(struct acpi_device *device, int type)
@@ -408,10 +393,8 @@ static int acpi_button_remove(struct acp
acpi_status status = 0;
struct acpi_button *button = NULL;
- ACPI_FUNCTION_TRACE("acpi_button_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
button = acpi_driver_data(device);
@@ -438,32 +421,28 @@ static int acpi_button_remove(struct acp
kfree(button);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_button_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_button_init");
-
acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
if (!acpi_button_dir)
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_button_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_button_driver);
if (result < 0) {
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_button_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_button_exit");
-
acpi_bus_unregister_driver(&acpi_button_driver);
if (acpi_power_dir)
@@ -474,7 +453,6 @@ static void __exit acpi_button_exit(void
remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
- return_VOID;
}
module_init(acpi_button_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 10/24] Remove unneeded debugging macros in drivers/acpi/fan.c
2006-04-18 1:21 ` [PATCH 9/24] Remove unneeded debugging macros in drivers/acpi/event.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 11/24] Remove unneeded debugging macros in drivers/acpi/hotkey.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/fan.c | 53 ++++++++++++++++++----------------------------------
1 files changed, 18 insertions(+), 35 deletions(-)
applies-to: c94bea86ad8c2fc4ba53c16055997112e6dedf86
9a0a67e1e7dd58323362c2e05a1ecf4c0a02beea
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 1495b86..208f0e1 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -74,8 +74,6 @@ static int acpi_fan_read_state(struct se
struct acpi_fan *fan = seq->private;
int state = 0;
- ACPI_FUNCTION_TRACE("acpi_fan_read_state");
-
if (fan) {
if (acpi_bus_get_power(fan->handle, &state))
seq_printf(seq, "status: ERROR\n");
@@ -83,7 +81,7 @@ static int acpi_fan_read_state(struct se
seq_printf(seq, "status: %s\n",
!state ? "on" : "off");
}
- return_VALUE(0);
+ return 0;
}
static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
@@ -100,22 +98,20 @@ acpi_fan_write_state(struct file *file,
struct acpi_fan *fan = (struct acpi_fan *)m->private;
char state_string[12] = { '\0' };
- ACPI_FUNCTION_TRACE("acpi_fan_write_state");
-
if (!fan || (count > sizeof(state_string) - 1))
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (copy_from_user(state_string, buffer, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
state_string[count] = '\0';
result = acpi_bus_set_power(fan->handle,
simple_strtoul(state_string, NULL, 0));
if (result)
- return_VALUE(result);
+ return result;
- return_VALUE(count);
+ return count;
}
static struct file_operations acpi_fan_state_ops = {
@@ -131,16 +127,14 @@ static int acpi_fan_add_fs(struct acpi_d
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_fan_add_fs");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_fan_dir);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE;
}
@@ -149,27 +143,25 @@ static int acpi_fan_add_fs(struct acpi_d
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_fan_state_ops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_fan_remove_fs(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
-
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_fan_dir);
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -182,14 +174,12 @@ static int acpi_fan_add(struct acpi_devi
struct acpi_fan *fan = NULL;
int state = 0;
- ACPI_FUNCTION_TRACE("acpi_fan_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL);
if (!fan)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(fan, 0, sizeof(struct acpi_fan));
fan->handle = device->handle;
@@ -215,17 +205,15 @@ static int acpi_fan_add(struct acpi_devi
if (result)
kfree(fan);
- return_VALUE(result);
+ return result;
}
static int acpi_fan_remove(struct acpi_device *device, int type)
{
struct acpi_fan *fan = NULL;
- ACPI_FUNCTION_TRACE("acpi_fan_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
fan = (struct acpi_fan *)acpi_driver_data(device);
@@ -233,38 +221,33 @@ static int acpi_fan_remove(struct acpi_d
kfree(fan);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_fan_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_fan_init");
-
acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
if (!acpi_fan_dir)
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_fan_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_fan_driver);
if (result < 0) {
remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_fan_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_fan_exit");
-
acpi_bus_unregister_driver(&acpi_fan_driver);
remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
- return_VOID;
}
module_init(acpi_fan_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 8/24] Remove unneeded debugging macros in drivers/acpi/ec.c
2006-04-18 1:21 ` [PATCH 7/24] Remove unneeded debugging macros in drivers/acpi/debug.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 9/24] Remove unneeded debugging macros in drivers/acpi/event.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/ec.c | 165 +++++++++++++++++++----------------------------------
1 files changed, 60 insertions(+), 105 deletions(-)
applies-to: cf24a0e712f1477d5d680c4649c79c0c83e2885b
98488685dd4e5edcb7b4cd83996082a5a9e7eaca
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 8745af7..943c382 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -207,8 +207,6 @@ static int acpi_ec_intr_wait(union acpi_
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_wait");
-
ec->intr.expect_event = event;
smp_mb();
@@ -216,7 +214,7 @@ static int acpi_ec_intr_wait(union acpi_
case ACPI_EC_EVENT_IBE:
if (~acpi_ec_read_status(ec) & event) {
ec->intr.expect_event = 0;
- return_VALUE(0);
+ return 0;
}
break;
default:
@@ -238,16 +236,16 @@ static int acpi_ec_intr_wait(union acpi_
switch (event) {
case ACPI_EC_EVENT_OBF:
if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF)
- return_VALUE(0);
+ return 0;
break;
case ACPI_EC_EVENT_IBE:
if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
- return_VALUE(0);
+ return 0;
break;
}
- return_VALUE(-ETIME);
+ return -ETIME;
}
#ifdef ACPI_FUTURE_USAGE
@@ -260,8 +258,6 @@ int acpi_ec_enter_burst_mode(union acpi_
u32 tmp = 0;
int status = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_enter_burst_mode");
-
status = acpi_ec_read_status(ec);
if (status != -EINVAL && !(status & ACPI_EC_FLAG_BURST)) {
status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
@@ -272,23 +268,21 @@ int acpi_ec_enter_burst_mode(union acpi_
status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr);
if (tmp != 0x90) { /* Burst ACK byte */
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
}
atomic_set(&ec->intr.leaving_burst, 0);
- return_VALUE(0);
+ return 0;
end:
ACPI_EXCEPTION ((AE_INFO, status, "EC wait, burst mode");
- return_VALUE(-1);
+ return -1;
}
int acpi_ec_leave_burst_mode(union acpi_ec *ec)
{
int status = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode");
-
status = acpi_ec_read_status(ec);
if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){
status = acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
@@ -298,10 +292,10 @@ int acpi_ec_leave_burst_mode(union acpi_
acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
}
atomic_set(&ec->intr.leaving_burst, 1);
- return_VALUE(0);
+ return 0;
end:
ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode");
- return_VALUE(-1);
+ return -1;
}
#endif /* ACPI_FUTURE_USAGE */
@@ -326,17 +320,15 @@ static int acpi_ec_poll_read(union acpi_
unsigned long flags = 0;
u32 glk = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_read");
-
if (!ec || !data)
- return_VALUE(-EINVAL);
+ return -EINVAL;
*data = 0;
if (ec->common.global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
spin_lock_irqsave(&ec->poll.lock, flags);
@@ -363,7 +355,7 @@ static int acpi_ec_poll_read(union acpi_
if (ec->common.global_lock)
acpi_release_global_lock(glk);
- return_VALUE(result);
+ return result;
}
static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
@@ -373,15 +365,13 @@ static int acpi_ec_poll_write(union acpi
unsigned long flags = 0;
u32 glk = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_write");
-
if (!ec)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (ec->common.global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
spin_lock_irqsave(&ec->poll.lock, flags);
@@ -411,7 +401,7 @@ static int acpi_ec_poll_write(union acpi
if (ec->common.global_lock)
acpi_release_global_lock(glk);
- return_VALUE(result);
+ return result;
}
static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
@@ -419,17 +409,15 @@ static int acpi_ec_intr_read(union acpi_
int status = 0;
u32 glk;
- ACPI_FUNCTION_TRACE("acpi_ec_read");
-
if (!ec || !data)
- return_VALUE(-EINVAL);
+ return -EINVAL;
*data = 0;
if (ec->common.global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
WARN_ON(in_interrupt());
@@ -463,7 +451,7 @@ static int acpi_ec_intr_read(union acpi_
if (ec->common.global_lock)
acpi_release_global_lock(glk);
- return_VALUE(status);
+ return status;
}
static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
@@ -471,15 +459,13 @@ static int acpi_ec_intr_write(union acpi
int status = 0;
u32 glk;
- ACPI_FUNCTION_TRACE("acpi_ec_write");
-
if (!ec)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (ec->common.global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
WARN_ON(in_interrupt());
@@ -512,7 +498,7 @@ static int acpi_ec_intr_write(union acpi
if (ec->common.global_lock)
acpi_release_global_lock(glk);
- return_VALUE(status);
+ return status;
}
/*
@@ -571,17 +557,15 @@ static int acpi_ec_poll_query(union acpi
unsigned long flags = 0;
u32 glk = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_query");
-
if (!ec || !data)
- return_VALUE(-EINVAL);
+ return -EINVAL;
*data = 0;
if (ec->common.global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
/*
@@ -607,23 +591,21 @@ static int acpi_ec_poll_query(union acpi
if (ec->common.global_lock)
acpi_release_global_lock(glk);
- return_VALUE(result);
+ return result;
}
static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
{
int status = 0;
u32 glk;
- ACPI_FUNCTION_TRACE("acpi_ec_query");
-
if (!ec || !data)
- return_VALUE(-EINVAL);
+ return -EINVAL;
*data = 0;
if (ec->common.global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
down(&ec->intr.sem);
@@ -656,7 +638,7 @@ static int acpi_ec_intr_query(union acpi
if (ec->common.global_lock)
acpi_release_global_lock(glk);
- return_VALUE(status);
+ return status;
}
/* --------------------------------------------------------------------------
@@ -686,8 +668,6 @@ static void acpi_ec_gpe_poll_query(void
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
- ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
-
if (!ec_cxt)
goto end;
@@ -727,8 +707,6 @@ static void acpi_ec_gpe_intr_query(void
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
- ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
-
if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI)
result = acpi_ec_query(ec, &value);
@@ -840,15 +818,13 @@ acpi_ec_space_handler(u32 function,
acpi_integer f_v = 0;
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
-
if ((address > 0xFF) || !value || !handler_context)
- return_VALUE(AE_BAD_PARAMETER);
+ return AE_BAD_PARAMETER;
if (bit_width != 8 && acpi_strict) {
printk(KERN_WARNING PREFIX
"acpi_ec_space_handler: bit_width should be 8\n");
- return_VALUE(AE_BAD_PARAMETER);
+ return AE_BAD_PARAMETER;
}
ec = (union acpi_ec *)handler_context;
@@ -887,16 +863,16 @@ acpi_ec_space_handler(u32 function,
out:
switch (result) {
case -EINVAL:
- return_VALUE(AE_BAD_PARAMETER);
+ return AE_BAD_PARAMETER;
break;
case -ENODEV:
- return_VALUE(AE_NOT_FOUND);
+ return AE_NOT_FOUND;
break;
case -ETIME:
- return_VALUE(AE_TIME);
+ return AE_TIME;
break;
default:
- return_VALUE(AE_OK);
+ return AE_OK;
}
}
@@ -910,8 +886,6 @@ static int acpi_ec_read_info(struct seq_
{
union acpi_ec *ec = (union acpi_ec *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_ec_read_info");
-
if (!ec)
goto end;
@@ -925,7 +899,7 @@ static int acpi_ec_read_info(struct seq_
acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
@@ -945,39 +919,35 @@ static int acpi_ec_add_fs(struct acpi_de
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_ec_add_fs");
-
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_ec_dir);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_ec_info_ops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_ec_remove_fs(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_ec_remove_fs");
-
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_ec_dir);
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -990,14 +960,12 @@ static int acpi_ec_poll_add(struct acpi_
acpi_status status = AE_OK;
union acpi_ec *ec = NULL;
- ACPI_FUNCTION_TRACE("acpi_ec_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
if (!ec)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(ec, 0, sizeof(union acpi_ec));
ec->common.handle = device->handle;
@@ -1050,7 +1018,7 @@ static int acpi_ec_poll_add(struct acpi_
if (result)
kfree(ec);
- return_VALUE(result);
+ return result;
}
static int acpi_ec_intr_add(struct acpi_device *device)
{
@@ -1058,14 +1026,12 @@ static int acpi_ec_intr_add(struct acpi_
acpi_status status = AE_OK;
union acpi_ec *ec = NULL;
- ACPI_FUNCTION_TRACE("acpi_ec_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
if (!ec)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(ec, 0, sizeof(union acpi_ec));
ec->common.handle = device->handle;
@@ -1121,17 +1087,15 @@ static int acpi_ec_intr_add(struct acpi_
if (result)
kfree(ec);
- return_VALUE(result);
+ return result;
}
static int acpi_ec_remove(struct acpi_device *device, int type)
{
union acpi_ec *ec = NULL;
- ACPI_FUNCTION_TRACE("acpi_ec_remove");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
ec = acpi_driver_data(device);
@@ -1139,7 +1103,7 @@ static int acpi_ec_remove(struct acpi_de
kfree(ec);
- return_VALUE(0);
+ return 0;
}
static acpi_status
@@ -1178,15 +1142,13 @@ static int acpi_ec_start(struct acpi_dev
acpi_status status = AE_OK;
union acpi_ec *ec = NULL;
- ACPI_FUNCTION_TRACE("acpi_ec_start");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
ec = acpi_driver_data(device);
if (!ec)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/*
* Get I/O port addresses. Convert to GAS format.
@@ -1196,7 +1158,7 @@ static int acpi_ec_start(struct acpi_dev
if (ACPI_FAILURE(status)
|| ec->common.command_addr.register_bit_width == 0) {
ACPI_ERROR((AE_INFO, "Error getting I/O port addresses"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
ec->common.status_addr = ec->common.command_addr;
@@ -1213,7 +1175,7 @@ static int acpi_ec_start(struct acpi_dev
ACPI_GPE_EDGE_TRIGGERED,
&acpi_ec_gpe_handler, ec);
if (ACPI_FAILURE(status)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
acpi_set_gpe_type(NULL, ec->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME);
acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
@@ -1225,10 +1187,10 @@ static int acpi_ec_start(struct acpi_dev
if (ACPI_FAILURE(status)) {
acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
&acpi_ec_gpe_handler);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(AE_OK);
+ return AE_OK;
}
static int acpi_ec_stop(struct acpi_device *device, int type)
@@ -1236,10 +1198,8 @@ static int acpi_ec_stop(struct acpi_devi
acpi_status status = AE_OK;
union acpi_ec *ec = NULL;
- ACPI_FUNCTION_TRACE("acpi_ec_stop");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
ec = acpi_driver_data(device);
@@ -1247,15 +1207,15 @@ static int acpi_ec_stop(struct acpi_devi
ACPI_ADR_SPACE_EC,
&acpi_ec_space_handler);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
status =
acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
&acpi_ec_gpe_handler);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
- return_VALUE(0);
+ return 0;
}
static acpi_status __init
@@ -1525,23 +1485,21 @@ static int __init acpi_ec_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_ec_init");
-
if (acpi_disabled)
- return_VALUE(0);
+ return 0;
acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir);
if (!acpi_ec_dir)
- return_VALUE(-ENODEV);
+ return -ENODEV;
/* Now register the driver for the EC */
result = acpi_bus_register_driver(&acpi_ec_driver);
if (result < 0) {
remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(result);
+ return result;
}
subsys_initcall(acpi_ec_init);
@@ -1550,13 +1508,10 @@ subsys_initcall(acpi_ec_init);
#if 0
static void __exit acpi_ec_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_ec_exit");
-
acpi_bus_unregister_driver(&acpi_ec_driver);
remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
- return_VOID;
}
#endif /* 0 */
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 11/24] Remove unneeded debugging macros in drivers/acpi/hotkey.c
2006-04-18 1:21 ` [PATCH 10/24] Remove unneeded debugging macros in drivers/acpi/fan.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 12/24] Remove unneeded debugging macros in drivers/acpi/motherboard.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/hotkey.c | 115 ++++++++++++++-----------------------------------
1 files changed, 34 insertions(+), 81 deletions(-)
applies-to: 7b8aca2a44864c5cde93e035b223a5317e749232
8773774970d07b8f36e55150d58609de77a244c4
diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c
index 37dcb1f..ed8a1ae 100644
--- a/drivers/acpi/hotkey.c
+++ b/drivers/acpi/hotkey.c
@@ -231,11 +231,9 @@ struct list_head hotkey_entries; /* head
static int hotkey_info_seq_show(struct seq_file *seq, void *offset)
{
- ACPI_FUNCTION_TRACE("hotkey_info_seq_show");
-
seq_printf(seq, "Hotkey generic driver ver: %s\n", HOTKEY_ACPI_VERSION);
- return_VALUE(0);
+ return 0;
}
static int hotkey_info_open_fs(struct inode *inode, struct file *file)
@@ -266,15 +264,13 @@ static int hotkey_polling_seq_show(struc
(struct acpi_polling_hotkey *)seq->private;
char *buf;
- ACPI_FUNCTION_TRACE("hotkey_polling_seq_show");
-
if (poll_hotkey->poll_result) {
buf = format_result(poll_hotkey->poll_result);
if (buf)
seq_printf(seq, "%s", buf);
kfree(buf);
}
- return_VALUE(0);
+ return 0;
}
static int hotkey_polling_open_fs(struct inode *inode, struct file *file)
@@ -293,8 +289,6 @@ static int hotkey_get_internal_event(int
struct list_head *entries;
int val = -1;
- ACPI_FUNCTION_TRACE("hotkey_get_internal_event");
-
list_for_each(entries, list->entries) {
union acpi_hotkey *key =
container_of(entries, union acpi_hotkey, entries);
@@ -305,7 +299,7 @@ static int hotkey_get_internal_event(int
}
}
- return_VALUE(val);
+ return val;
}
static void
@@ -314,15 +308,12 @@ acpi_hotkey_notify_handler(acpi_handle h
struct acpi_device *device = NULL;
u32 internal_event;
- ACPI_FUNCTION_TRACE("acpi_hotkey_notify_handler");
-
if (acpi_bus_get_device(handle, &device))
- return_VOID;
+ return;
internal_event = hotkey_get_internal_event(event, &global_hotkey_list);
acpi_bus_generate_event(device, internal_event, 0);
- return_VOID;
}
/* Need to invent automatically hotkey add method */
@@ -344,10 +335,7 @@ static int create_polling_proc(union acp
{
struct proc_dir_entry *proc;
char proc_name[80];
- mode_t mode;
-
- ACPI_FUNCTION_TRACE("create_polling_proc");
- mode = S_IFREG | S_IRUGO | S_IWUGO;
+ mode_t mode = S_IFREG | S_IRUGO | S_IWUGO;
sprintf(proc_name, "%d", device->link.hotkey_standard_num);
/*
@@ -356,7 +344,7 @@ static int create_polling_proc(union acp
proc = create_proc_entry(proc_name, mode, hotkey_proc_dir);
if (!proc) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
} else {
proc->proc_fops = &hotkey_polling_fops;
proc->owner = THIS_MODULE;
@@ -365,7 +353,7 @@ static int create_polling_proc(union acp
proc->gid = 0;
device->poll_hotkey.proc = proc;
}
- return_VALUE(0);
+ return 0;
}
static int hotkey_add(union acpi_hotkey *device)
@@ -373,8 +361,6 @@ static int hotkey_add(union acpi_hotkey
int status = 0;
struct acpi_device *dev = NULL;
- ACPI_FUNCTION_TRACE("hotkey_add");
-
if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) {
acpi_bus_get_device(device->event_hotkey.bus_handle, &dev);
status = acpi_install_notify_handler(dev->handle,
@@ -388,15 +374,13 @@ static int hotkey_add(union acpi_hotkey
list_add_tail(&device->link.entries, global_hotkey_list.entries);
- return_VALUE(status);
+ return status;
}
static int hotkey_remove(union acpi_hotkey *device)
{
struct list_head *entries, *next;
- ACPI_FUNCTION_TRACE("hotkey_remove");
-
list_for_each_safe(entries, next, global_hotkey_list.entries) {
union acpi_hotkey *key =
container_of(entries, union acpi_hotkey, entries);
@@ -409,15 +393,13 @@ static int hotkey_remove(union acpi_hotk
}
}
kfree(device);
- return_VALUE(0);
+ return 0;
}
static int hotkey_update(union acpi_hotkey *key)
{
struct list_head *entries;
- ACPI_FUNCTION_TRACE("hotkey_update");
-
list_for_each(entries, global_hotkey_list.entries) {
union acpi_hotkey *tmp =
container_of(entries, union acpi_hotkey, entries);
@@ -458,20 +440,18 @@ static int hotkey_update(union acpi_hotk
*/
kfree(key);
}
- return_VALUE(0);
+ return 0;
break;
}
}
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
static void free_hotkey_device(union acpi_hotkey *key)
{
struct acpi_device *dev;
- ACPI_FUNCTION_TRACE("free_hotkey_device");
-
if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) {
acpi_bus_get_device(key->event_hotkey.bus_handle, &dev);
if (dev->handle)
@@ -490,7 +470,6 @@ static void free_hotkey_device(union acp
free_poll_hotkey_buffer(key);
}
kfree(key);
- return_VOID;
}
static void free_hotkey_buffer(union acpi_hotkey *key)
@@ -511,8 +490,6 @@ init_hotkey_device(union acpi_hotkey *ke
acpi_handle tmp_handle;
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("init_hotkey_device");
-
if (std_num < 0 || IS_POLL(std_num) || !key)
goto do_fail;
@@ -538,9 +515,9 @@ init_hotkey_device(union acpi_hotkey *ke
method, &tmp_handle);
if (ACPI_FAILURE(status))
goto do_fail;
- return_VALUE(AE_OK);
+ return AE_OK;
do_fail:
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
static int
@@ -552,8 +529,6 @@ init_poll_hotkey_device(union acpi_hotke
acpi_status status = AE_OK;
acpi_handle tmp_handle;
- ACPI_FUNCTION_TRACE("init_poll_hotkey_device");
-
if (std_num < 0 || IS_EVENT(std_num) || !key)
goto do_fail;
@@ -587,23 +562,19 @@ init_poll_hotkey_device(union acpi_hotke
(union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL);
if (!key->poll_hotkey.poll_result)
goto do_fail;
- return_VALUE(AE_OK);
+ return AE_OK;
do_fail:
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
static int hotkey_open_config(struct inode *inode, struct file *file)
{
- ACPI_FUNCTION_TRACE("hotkey_open_config");
- return_VALUE(single_open
- (file, hotkey_config_seq_show, PDE(inode)->data));
+ return single_open(file, hotkey_config_seq_show, PDE(inode)->data);
}
static int hotkey_poll_open_config(struct inode *inode, struct file *file)
{
- ACPI_FUNCTION_TRACE("hotkey_poll_open_config");
- return_VALUE(single_open
- (file, hotkey_poll_config_seq_show, PDE(inode)->data));
+ return single_open(file, hotkey_poll_config_seq_show, PDE(inode)->data);
}
static int hotkey_config_seq_show(struct seq_file *seq, void *offset)
@@ -615,8 +586,6 @@ static int hotkey_config_seq_show(struct
struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
- ACPI_FUNCTION_TRACE(("hotkey_config_seq_show"));
-
list_for_each(entries, hotkey_list->entries) {
union acpi_hotkey *key =
container_of(entries, union acpi_hotkey, entries);
@@ -633,7 +602,7 @@ static int hotkey_config_seq_show(struct
}
}
seq_puts(seq, "\n");
- return_VALUE(0);
+ return 0;
}
static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
@@ -645,8 +614,6 @@ static int hotkey_poll_config_seq_show(s
struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
- ACPI_FUNCTION_TRACE(("hotkey_config_seq_show"));
-
list_for_each(entries, hotkey_list->entries) {
union acpi_hotkey *key =
container_of(entries, union acpi_hotkey, entries);
@@ -663,7 +630,7 @@ static int hotkey_poll_config_seq_show(s
}
}
seq_puts(seq, "\n");
- return_VALUE(0);
+ return 0;
}
static int
@@ -675,8 +642,6 @@ get_parms(char *config_record,
char **method, int *internal_event_num, int *external_event_num)
{
char *tmp, *tmp1, count;
- ACPI_FUNCTION_TRACE(("get_parms"));
-
sscanf(config_record, "%d", cmd);
if (*cmd == 1) {
@@ -741,9 +706,9 @@ get_parms(char *config_record,
0)
goto do_fail;
- return_VALUE(6);
+ return 6;
do_fail:
- return_VALUE(-1);
+ return -1;
}
/* count is length for one input record */
@@ -760,16 +725,14 @@ static ssize_t hotkey_write_config(struc
int ret = 0;
union acpi_hotkey *key = NULL;
- ACPI_FUNCTION_TRACE(("hotkey_write_config"));
-
config_record = (char *)kmalloc(count + 1, GFP_KERNEL);
if (!config_record)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
if (copy_from_user(config_record, buffer, count)) {
kfree(config_record);
ACPI_ERROR((AE_INFO, "Invalid data"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
config_record[count] = 0;
@@ -790,7 +753,7 @@ static ssize_t hotkey_write_config(struc
kfree(action_handle);
kfree(method);
ACPI_ERROR((AE_INFO, "Invalid data format ret=%d", ret));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL);
@@ -825,7 +788,7 @@ static ssize_t hotkey_write_config(struc
free_poll_hotkey_buffer(key);
kfree(key);
ACPI_ERROR((AE_INFO, "Invalid hotkey"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
cont_cmd:
@@ -851,7 +814,7 @@ static ssize_t hotkey_write_config(struc
goto fail_out;
break;
}
- return_VALUE(count);
+ return count;
fail_out:
if (IS_EVENT(internal_event_num))
free_hotkey_buffer(key);
@@ -859,7 +822,7 @@ static ssize_t hotkey_write_config(struc
free_poll_hotkey_buffer(key);
kfree(key);
ACPI_ERROR((AE_INFO, "invalid key"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
/*
@@ -876,15 +839,13 @@ static int write_acpi_int(acpi_handle ha
union acpi_object in_obj; /* the only param we use */
acpi_status status;
- ACPI_FUNCTION_TRACE("write_acpi_int");
- params.count = 1;
params.pointer = &in_obj;
in_obj.type = ACPI_TYPE_INTEGER;
in_obj.integer.value = val;
status = acpi_evaluate_object(handle, (char *)method, ¶ms, output);
- return_VALUE(status == AE_OK);
+ return status == AE_OK;
}
static int read_acpi_int(acpi_handle handle, const char *method,
@@ -894,8 +855,6 @@ static int read_acpi_int(acpi_handle han
union acpi_object out_obj;
acpi_status status;
- ACPI_FUNCTION_TRACE("read_acpi_int");
- output.length = sizeof(out_obj);
output.pointer = &out_obj;
status = acpi_evaluate_object(handle, (char *)method, NULL, &output);
@@ -941,24 +900,22 @@ static ssize_t hotkey_execute_aml_method
int event, method_type, type, value;
union acpi_hotkey *key;
- ACPI_FUNCTION_TRACE("hotkey_execte_aml_method");
-
arg = (char *)kmalloc(count + 1, GFP_KERNEL);
if (!arg)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
arg[count] = 0;
if (copy_from_user(arg, buffer, count)) {
kfree(arg);
ACPI_ERROR((AE_INFO, "Invalid argument 2"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) !=
4) {
kfree(arg);
ACPI_ERROR((AE_INFO, "Invalid argument 3"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
kfree(arg);
if (type == ACPI_TYPE_INTEGER) {
@@ -984,11 +941,11 @@ static ssize_t hotkey_execute_aml_method
}
} else {
ACPI_WARNING((AE_INFO, "Not supported"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
- return_VALUE(count);
+ return count;
do_fail:
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
@@ -997,8 +954,6 @@ static int __init hotkey_init(void)
int result;
mode_t mode = S_IFREG | S_IRUGO | S_IWUGO;
- ACPI_FUNCTION_TRACE("hotkey_init");
-
if (acpi_disabled)
return -ENODEV;
@@ -1084,8 +1039,6 @@ static void __exit hotkey_exit(void)
{
struct list_head *entries, *next;
- ACPI_FUNCTION_TRACE("hotkey_exit");
-
list_for_each_safe(entries, next, global_hotkey_list.entries) {
union acpi_hotkey *key =
container_of(entries, union acpi_hotkey, entries);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 17/24] Remove unneeded debugging macros in drivers/acpi/power.c
2006-04-18 1:21 ` [PATCH 16/24] Remove unneeded debugging macros in drivers/acpi/pci_root.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 18/24] Remove unneeded debugging macros in drivers/acpi/processor_core.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/power.c | 140 ++++++++++++++++++++------------------------------
1 files changed, 55 insertions(+), 85 deletions(-)
applies-to: bbcbce350a6c83f5c0e5d95111a3ea77adedabed
b65bba570994c73ce90561b3e260aaca41f05bb8
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 5712803..aaefc12 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -98,22 +98,20 @@ acpi_power_get_context(acpi_handle handl
int result = 0;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_power_get_context");
-
if (!resource)
- return_VALUE(-ENODEV);
+ return -ENODEV;
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_WARNING((AE_INFO, "Getting context [%p]", handle));
- return_VALUE(result);
+ return result;
}
*resource = (struct acpi_power_resource *)acpi_driver_data(device);
if (!resource)
- return_VALUE(-ENODEV);
+ return -ENODEV;
- return_VALUE(0);
+ return 0;
}
static int acpi_power_get_state(struct acpi_power_resource *resource)
@@ -121,14 +119,12 @@ static int acpi_power_get_state(struct a
acpi_status status = AE_OK;
unsigned long sta = 0;
- ACPI_FUNCTION_TRACE("acpi_power_get_state");
-
if (!resource)
- return_VALUE(-EINVAL);
+ return -EINVAL;
status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
if (sta & 0x01)
resource->state = ACPI_POWER_RESOURCE_STATE_ON;
@@ -138,7 +134,7 @@ static int acpi_power_get_state(struct a
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
resource->name, resource->state ? "on" : "off"));
- return_VALUE(0);
+ return 0;
}
static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
@@ -147,20 +143,18 @@ static int acpi_power_get_list_state(str
struct acpi_power_resource *resource = NULL;
u32 i = 0;
- ACPI_FUNCTION_TRACE("acpi_power_get_list_state");
-
if (!list || !state)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* The state of the list is 'on' IFF all resources are 'on'. */
for (i = 0; i < list->count; i++) {
result = acpi_power_get_context(list->handles[i], &resource);
if (result)
- return_VALUE(result);
+ return result;
result = acpi_power_get_state(resource);
if (result)
- return_VALUE(result);
+ return result;
*state = resource->state;
@@ -171,7 +165,7 @@ static int acpi_power_get_list_state(str
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n",
*state ? "on" : "off"));
- return_VALUE(result);
+ return result;
}
static int acpi_power_on(acpi_handle handle)
@@ -181,11 +175,9 @@ static int acpi_power_on(acpi_handle han
struct acpi_device *device = NULL;
struct acpi_power_resource *resource = NULL;
- ACPI_FUNCTION_TRACE("acpi_power_on");
-
result = acpi_power_get_context(handle, &resource);
if (result)
- return_VALUE(result);
+ return result;
resource->references++;
@@ -193,29 +185,29 @@ static int acpi_power_on(acpi_handle han
|| (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n",
resource->name));
- return_VALUE(0);
+ return 0;
}
status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
result = acpi_power_get_state(resource);
if (result)
- return_VALUE(result);
+ return result;
if (resource->state != ACPI_POWER_RESOURCE_STATE_ON)
- return_VALUE(-ENOEXEC);
+ return -ENOEXEC;
/* Update the power resource's _device_ power state */
result = acpi_bus_get_device(resource->handle, &device);
if (result)
- return_VALUE(result);
+ return result;
device->power.state = ACPI_STATE_D0;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n",
resource->name));
- return_VALUE(0);
+ return 0;
}
static int acpi_power_off_device(acpi_handle handle)
@@ -225,11 +217,9 @@ static int acpi_power_off_device(acpi_ha
struct acpi_device *device = NULL;
struct acpi_power_resource *resource = NULL;
- ACPI_FUNCTION_TRACE("acpi_power_off_device");
-
result = acpi_power_get_context(handle, &resource);
if (result)
- return_VALUE(result);
+ return result;
if (resource->references)
resource->references--;
@@ -238,35 +228,35 @@ static int acpi_power_off_device(acpi_ha
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Resource [%s] is still in use, dereferencing\n",
device->pnp.bus_id));
- return_VALUE(0);
+ return 0;
}
if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n",
device->pnp.bus_id));
- return_VALUE(0);
+ return 0;
}
status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
result = acpi_power_get_state(resource);
if (result)
- return_VALUE(result);
+ return result;
if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF)
- return_VALUE(-ENOEXEC);
+ return -ENOEXEC;
/* Update the power resource's _device_ power state */
result = acpi_bus_get_device(resource->handle, &device);
if (result)
- return_VALUE(result);
+ return result;
device->power.state = ACPI_STATE_D3;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n",
resource->name));
- return_VALUE(0);
+ return 0;
}
/*
@@ -282,9 +272,7 @@ int acpi_enable_wakeup_device_power(stru
int i;
int ret = 0;
- ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device_power");
- if (!dev || !dev->wakeup.flags.valid)
- return_VALUE(-1);
+ return -1;
arg.integer.value = 1;
/* Open power resource */
@@ -293,7 +281,7 @@ int acpi_enable_wakeup_device_power(stru
if (ret) {
ACPI_ERROR((AE_INFO, "Transition power state"));
dev->wakeup.flags.valid = 0;
- return_VALUE(-1);
+ return -1;
}
}
@@ -305,7 +293,7 @@ int acpi_enable_wakeup_device_power(stru
ret = -1;
}
- return_VALUE(ret);
+ return ret;
}
/*
@@ -321,10 +309,8 @@ int acpi_disable_wakeup_device_power(str
int i;
int ret = 0;
- ACPI_FUNCTION_TRACE("acpi_disable_wakeup_device_power");
-
if (!dev || !dev->wakeup.flags.valid)
- return_VALUE(-1);
+ return -1;
arg.integer.value = 0;
/* Execute PSW */
@@ -332,7 +318,7 @@ int acpi_disable_wakeup_device_power(str
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
ACPI_ERROR((AE_INFO, "Evaluate _PSW"));
dev->wakeup.flags.valid = 0;
- return_VALUE(-1);
+ return -1;
}
/* Close power resource */
@@ -341,11 +327,11 @@ int acpi_disable_wakeup_device_power(str
if (ret) {
ACPI_ERROR((AE_INFO, "Transition power state"));
dev->wakeup.flags.valid = 0;
- return_VALUE(-1);
+ return -1;
}
}
- return_VALUE(ret);
+ return ret;
}
/* --------------------------------------------------------------------------
@@ -359,10 +345,8 @@ int acpi_power_get_inferred_state(struct
int list_state = 0;
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_power_get_inferred_state");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
device->power.state = ACPI_STATE_UNKNOWN;
@@ -377,17 +361,17 @@ int acpi_power_get_inferred_state(struct
result = acpi_power_get_list_state(list, &list_state);
if (result)
- return_VALUE(result);
+ return result;
if (list_state == ACPI_POWER_RESOURCE_STATE_ON) {
device->power.state = i;
- return_VALUE(0);
+ return 0;
}
}
device->power.state = ACPI_STATE_D3;
- return_VALUE(0);
+ return 0;
}
int acpi_power_transition(struct acpi_device *device, int state)
@@ -397,14 +381,12 @@ int acpi_power_transition(struct acpi_de
struct acpi_handle_list *tl = NULL; /* Target Resources */
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_power_transition");
-
if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
- return_VALUE(-EINVAL);
+ return -EINVAL;
if ((device->power.state < ACPI_STATE_D0)
|| (device->power.state > ACPI_STATE_D3))
- return_VALUE(-ENODEV);
+ return -ENODEV;
cl = &device->power.states[device->power.state].resources;
tl = &device->power.states[state].resources;
@@ -444,7 +426,7 @@ int acpi_power_transition(struct acpi_de
ACPI_WARNING((AE_INFO, "Transitioning device [%s] to D%d",
device->pnp.bus_id, state));
- return_VALUE(result);
+ return result;
}
/* --------------------------------------------------------------------------
@@ -457,8 +439,6 @@ static int acpi_power_seq_show(struct se
{
struct acpi_power_resource *resource = NULL;
- ACPI_FUNCTION_TRACE("acpi_power_seq_show");
-
resource = (struct acpi_power_resource *)seq->private;
if (!resource)
@@ -484,7 +464,7 @@ static int acpi_power_seq_show(struct se
resource->order, resource->references);
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_power_open_fs(struct inode *inode, struct file *file)
@@ -496,35 +476,31 @@ static int acpi_power_add_fs(struct acpi
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_power_add_fs");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_power_dir);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
/* 'status' [R] */
entry = create_proc_entry(ACPI_POWER_FILE_STATUS,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-EIO);
+ return -EIO;
else {
entry->proc_fops = &acpi_power_fops;
entry->data = acpi_driver_data(device);
}
- return_VALUE(0);
+ return 0;
}
static int acpi_power_remove_fs(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_power_remove_fs");
-
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_POWER_FILE_STATUS,
acpi_device_dir(device));
@@ -532,7 +508,7 @@ static int acpi_power_remove_fs(struct a
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -547,14 +523,12 @@ static int acpi_power_add(struct acpi_de
union acpi_object acpi_object;
struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object };
- ACPI_FUNCTION_TRACE("acpi_power_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
resource = kmalloc(sizeof(struct acpi_power_resource), GFP_KERNEL);
if (!resource)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(resource, 0, sizeof(struct acpi_power_resource));
resource->handle = device->handle;
@@ -599,17 +573,15 @@ static int acpi_power_add(struct acpi_de
if (result)
kfree(resource);
- return_VALUE(result);
+ return result;
}
static int acpi_power_remove(struct acpi_device *device, int type)
{
struct acpi_power_resource *resource = NULL;
- ACPI_FUNCTION_TRACE("acpi_power_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
resource = (struct acpi_power_resource *)acpi_driver_data(device);
@@ -617,31 +589,29 @@ static int acpi_power_remove(struct acpi
kfree(resource);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_power_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_power_init");
-
if (acpi_disabled)
- return_VALUE(0);
+ return 0;
INIT_LIST_HEAD(&acpi_power_resource_list);
acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir);
if (!acpi_power_dir)
- return_VALUE(-ENODEV);
+ return -ENODEV;
result = acpi_bus_register_driver(&acpi_power_driver);
if (result < 0) {
remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
subsys_initcall(acpi_power_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 16/24] Remove unneeded debugging macros in drivers/acpi/pci_root.c
2006-04-18 1:21 ` [PATCH 15/24] Remove unneeded debugging macros in drivers/acpi/pci_link.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 17/24] Remove unneeded debugging macros in drivers/acpi/power.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/pci_root.c | 28 ++++++++++------------------
1 files changed, 10 insertions(+), 18 deletions(-)
applies-to: c6ff3432977bb902db1ed7a95e60aad33ca3ab67
9c5964188934da0cb084a3beafc750255f2abb02
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 0f661dd..3dcc091 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -160,14 +160,12 @@ static int acpi_pci_root_add(struct acpi
unsigned long value = 0;
acpi_handle handle = NULL;
- ACPI_FUNCTION_TRACE("acpi_pci_root_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
if (!root)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(root, 0, sizeof(struct acpi_pci_root));
INIT_LIST_HEAD(&root->node);
@@ -307,46 +305,40 @@ static int acpi_pci_root_add(struct acpi
kfree(root);
}
- return_VALUE(result);
+ return result;
}
static int acpi_pci_root_start(struct acpi_device *device)
{
struct acpi_pci_root *root;
- ACPI_FUNCTION_TRACE("acpi_pci_root_start");
-
list_for_each_entry(root, &acpi_pci_roots, node) {
if (root->handle == device->handle) {
pci_bus_add_devices(root->bus);
- return_VALUE(0);
+ return 0;
}
}
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
static int acpi_pci_root_remove(struct acpi_device *device, int type)
{
struct acpi_pci_root *root = NULL;
- ACPI_FUNCTION_TRACE("acpi_pci_root_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
root = (struct acpi_pci_root *)acpi_driver_data(device);
kfree(root);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_pci_root_init(void)
{
- ACPI_FUNCTION_TRACE("acpi_pci_root_init");
-
if (acpi_pci_disabled)
- return_VALUE(0);
+ return 0;
/* DEBUG:
acpi_dbg_layer = ACPI_PCI_COMPONENT;
@@ -354,9 +346,9 @@ static int __init acpi_pci_root_init(voi
*/
if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
- return_VALUE(-ENODEV);
+ return -ENODEV;
- return_VALUE(0);
+ return 0;
}
subsys_initcall(acpi_pci_root_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 12/24] Remove unneeded debugging macros in drivers/acpi/motherboard.c
2006-04-18 1:21 ` [PATCH 11/24] Remove unneeded debugging macros in drivers/acpi/hotkey.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 13/24] Remove unneeded debugging macros in drivers/acpi/pci_bind.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/motherboard.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
applies-to: 6643f7750035d5b7643f99e120f0a7d69da614af
e16d43106000085dfa970f8a94bdd0b6d0f61e4b
diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c
index d51d68f..ac74e6c 100644
--- a/drivers/acpi/motherboard.c
+++ b/drivers/acpi/motherboard.c
@@ -52,13 +52,11 @@ static acpi_status acpi_reserve_io_range
{
struct resource *requested_res = NULL;
- ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
-
if (res->type == ACPI_RESOURCE_TYPE_IO) {
struct acpi_resource_io *io_res = &res->data.io;
if (io_res->minimum != io_res->maximum)
- return_VALUE(AE_OK);
+ return AE_OK;
if (IS_RESERVED_ADDR
(io_res->minimum, io_res->address_length)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -92,7 +90,7 @@ static acpi_status acpi_reserve_io_range
if (requested_res)
requested_res->flags &= ~IORESOURCE_BUSY;
- return_VALUE(AE_OK);
+ return AE_OK;
}
static int acpi_motherboard_add(struct acpi_device *device)
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 18/24] Remove unneeded debugging macros in drivers/acpi/processor_core.c
2006-04-18 1:21 ` [PATCH 17/24] Remove unneeded debugging macros in drivers/acpi/power.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 19/24] Remove unneeded debugging macros in drivers/acpi/processor_idle.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/processor_core.c | 125 ++++++++++++++---------------------------
1 files changed, 44 insertions(+), 81 deletions(-)
applies-to: fba2f5dacfe5a7967eadf3117a992745067a647f
6fb420237bb78f868964ae790cee1a77f47d8e54
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 7639bb7..29f8120 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -122,10 +122,8 @@ static int acpi_processor_errata_piix4(s
u8 value1 = 0;
u8 value2 = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_errata_piix4");
-
if (!dev)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/*
* Note that 'dev' references the PIIX4 ACPI Controller.
@@ -218,7 +216,7 @@ static int acpi_processor_errata_piix4(s
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Type-F DMA livelock erratum (C3 disabled)\n"));
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_errata(struct acpi_processor *pr)
@@ -226,10 +224,8 @@ static int acpi_processor_errata(struct
int result = 0;
struct pci_dev *dev = NULL;
- ACPI_FUNCTION_TRACE("acpi_processor_errata");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/*
* PIIX4
@@ -242,7 +238,7 @@ static int acpi_processor_errata(struct
pci_dev_put(dev);
}
- return_VALUE(result);
+ return result;
}
/* --------------------------------------------------------------------------
@@ -258,10 +254,8 @@ static int acpi_processor_set_pdc(struct
struct acpi_object_list *pdc_in = pr->pdc;
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");
-
if (!pdc_in)
- return_VALUE(status);
+ return status;
status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
@@ -269,7 +263,7 @@ static int acpi_processor_set_pdc(struct
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Could not evaluate _PDC, using legacy perf. control...\n"));
- return_VALUE(status);
+ return status;
}
/* --------------------------------------------------------------------------
@@ -282,8 +276,6 @@ static int acpi_processor_info_seq_show(
{
struct acpi_processor *pr = (struct acpi_processor *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_processor_info_seq_show");
-
if (!pr)
goto end;
@@ -301,7 +293,7 @@ static int acpi_processor_info_seq_show(
pr->flags.limit ? "yes" : "no");
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_info_open_fs(struct inode *inode, struct file *file)
@@ -314,13 +306,11 @@ static int acpi_processor_add_fs(struct
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_processor_add_fs");
-
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_processor_dir);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
acpi_device_dir(device)->owner = THIS_MODULE;
@@ -328,7 +318,7 @@ static int acpi_processor_add_fs(struct
entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-EIO);
+ return -EIO;
else {
entry->proc_fops = &acpi_processor_info_fops;
entry->data = acpi_driver_data(device);
@@ -340,7 +330,7 @@ static int acpi_processor_add_fs(struct
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- return_VALUE(-EIO);
+ return -EIO;
else {
entry->proc_fops = &acpi_processor_throttling_fops;
entry->data = acpi_driver_data(device);
@@ -352,20 +342,18 @@ static int acpi_processor_add_fs(struct
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- return_VALUE( -EIO);
+ return -EIO;
else {
entry->proc_fops = &acpi_processor_limit_fops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_remove_fs(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_processor_remove_fs");
-
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_PROCESSOR_FILE_INFO,
acpi_device_dir(device));
@@ -377,7 +365,7 @@ static int acpi_processor_remove_fs(stru
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* Use the acpiid in MADT to map cpus in case of SMP */
@@ -424,10 +412,8 @@ static int acpi_processor_get_info(struc
int cpu_index;
static int cpu0_initialized;
- ACPI_FUNCTION_TRACE("acpi_processor_get_info");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (num_online_cpus() > 1)
errata.smp = TRUE;
@@ -454,7 +440,7 @@ static int acpi_processor_get_info(struc
status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "Evaluating processor object"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
/*
@@ -486,7 +472,7 @@ static int acpi_processor_get_info(struc
ACPI_ERROR((AE_INFO,
"Getting cpuindex for acpiid 0x%x",
pr->acpi_id));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
}
@@ -521,7 +507,7 @@ static int acpi_processor_get_info(struc
acpi_processor_get_throttling_info(pr);
acpi_processor_get_limit_info(pr);
- return_VALUE(0);
+ return 0;
}
static void *processor_device_array[NR_CPUS];
@@ -532,14 +518,12 @@ static int acpi_processor_start(struct a
acpi_status status = AE_OK;
struct acpi_processor *pr;
- ACPI_FUNCTION_TRACE("acpi_processor_start");
-
pr = acpi_driver_data(device);
result = acpi_processor_get_info(pr);
if (result) {
/* Processor is physically not present */
- return_VALUE(0);
+ return 0;
}
BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));
@@ -553,7 +537,7 @@ static int acpi_processor_start(struct a
processor_device_array[pr->id] != (void *)device) {
printk(KERN_WARNING "BIOS reported wrong ACPI id"
"for the processor\n");
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
processor_device_array[pr->id] = (void *)device;
@@ -581,7 +565,7 @@ static int acpi_processor_start(struct a
end:
- return_VALUE(result);
+ return result;
}
static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
@@ -589,13 +573,11 @@ static void acpi_processor_notify(acpi_h
struct acpi_processor *pr = (struct acpi_processor *)data;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_processor_notify");
-
if (!pr)
- return_VOID;
+ return;
if (acpi_bus_get_device(pr->handle, &device))
- return_VOID;
+ return;
switch (event) {
case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
@@ -613,21 +595,18 @@ static void acpi_processor_notify(acpi_h
break;
}
- return_VOID;
}
static int acpi_processor_add(struct acpi_device *device)
{
struct acpi_processor *pr = NULL;
- ACPI_FUNCTION_TRACE("acpi_processor_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
pr = kmalloc(sizeof(struct acpi_processor), GFP_KERNEL);
if (!pr)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(pr, 0, sizeof(struct acpi_processor));
pr->handle = device->handle;
@@ -635,7 +614,7 @@ static int acpi_processor_add(struct acp
strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
acpi_driver_data(device) = pr;
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_remove(struct acpi_device *device, int type)
@@ -643,21 +622,19 @@ static int acpi_processor_remove(struct
acpi_status status = AE_OK;
struct acpi_processor *pr = NULL;
- ACPI_FUNCTION_TRACE("acpi_processor_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
pr = (struct acpi_processor *)acpi_driver_data(device);
if (pr->id >= NR_CPUS) {
kfree(pr);
- return_VALUE(0);
+ return 0;
}
if (type == ACPI_BUS_REMOVAL_EJECT) {
if (acpi_processor_handle_eject(pr))
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
acpi_processor_power_exit(pr, device);
@@ -671,7 +648,7 @@ static int acpi_processor_remove(struct
kfree(pr);
- return_VALUE(0);
+ return 0;
}
#ifdef CONFIG_ACPI_HOTPLUG_CPU
@@ -686,14 +663,12 @@ static int is_processor_present(acpi_han
acpi_status status;
unsigned long sta = 0;
- ACPI_FUNCTION_TRACE("is_processor_present");
-
status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
- return_VALUE(0);
+ return 0;
}
- return_VALUE(1);
+ return 1;
}
static
@@ -703,30 +678,28 @@ int acpi_processor_device_add(acpi_handl
struct acpi_device *pdev;
struct acpi_processor *pr;
- ACPI_FUNCTION_TRACE("acpi_processor_device_add");
-
if (acpi_get_parent(handle, &phandle)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
if (acpi_bus_get_device(phandle, &pdev)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_PROCESSOR)) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
acpi_bus_start(*device);
pr = acpi_driver_data(*device);
if (!pr)
- return_VALUE(-ENODEV);
+ return -ENODEV;
if ((pr->id >= 0) && (pr->id < NR_CPUS)) {
kobject_uevent(&(*device)->kobj, KOBJ_ONLINE);
}
- return_VALUE(0);
+ return 0;
}
static void
@@ -736,8 +709,6 @@ acpi_processor_hotplug_notify(acpi_handl
struct acpi_device *device = NULL;
int result;
- ACPI_FUNCTION_TRACE("acpi_processor_hotplug_notify");
-
switch (event) {
case ACPI_NOTIFY_BUS_CHECK:
case ACPI_NOTIFY_DEVICE_CHECK:
@@ -788,7 +759,7 @@ acpi_processor_hotplug_notify(acpi_handl
if (!pr) {
ACPI_ERROR((AE_INFO,
"Driver data is NULL, dropping EJECT"));
- return_VOID;
+ return;
}
if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
@@ -800,7 +771,6 @@ acpi_processor_hotplug_notify(acpi_handl
break;
}
- return_VOID;
}
static acpi_status
@@ -839,21 +809,19 @@ processor_walk_namespace_cb(acpi_handle
static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu)
{
- ACPI_FUNCTION_TRACE("acpi_processor_hotadd_init");
-
if (!is_processor_present(handle)) {
- return_VALUE(AE_ERROR);
+ return AE_ERROR;
}
if (acpi_map_lsapic(handle, p_cpu))
- return_VALUE(AE_ERROR);
+ return AE_ERROR;
if (arch_register_cpu(*p_cpu)) {
acpi_unmap_lsapic(*p_cpu);
- return_VALUE(AE_ERROR);
+ return AE_ERROR;
}
- return_VALUE(AE_OK);
+ return AE_OK;
}
static int acpi_processor_handle_eject(struct acpi_processor *pr)
@@ -910,20 +878,18 @@ static int __init acpi_processor_init(vo
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_init");
-
memset(&processors, 0, sizeof(processors));
memset(&errata, 0, sizeof(errata));
acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
if (!acpi_processor_dir)
- return_VALUE(0);
+ return 0;
acpi_processor_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_processor_driver);
if (result < 0) {
remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
- return_VALUE(0);
+ return 0;
}
acpi_processor_install_hotplug_notify();
@@ -932,13 +898,11 @@ static int __init acpi_processor_init(vo
acpi_processor_ppc_init();
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_processor_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_processor_exit");
-
acpi_processor_ppc_exit();
acpi_thermal_cpufreq_exit();
@@ -949,7 +913,6 @@ static void __exit acpi_processor_exit(v
remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
- return_VOID;
}
module_init(acpi_processor_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 13/24] Remove unneeded debugging macros in drivers/acpi/pci_bind.c
2006-04-18 1:21 ` [PATCH 12/24] Remove unneeded debugging macros in drivers/acpi/motherboard.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 14/24] Remove unneeded debugging macros in drivers/acpi/pci_irq.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/pci_bind.c | 41 +++++++++++++++--------------------------
1 files changed, 15 insertions(+), 26 deletions(-)
applies-to: a8e46bdcced6e4e56cabe4f8c4c58e76af3e9671
1a7ebc037b5c3f783c160fad42cf2d05ee5d8431
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
index 6d3e818..e4b6990 100644
--- a/drivers/acpi/pci_bind.c
+++ b/drivers/acpi/pci_bind.c
@@ -47,11 +47,8 @@ struct acpi_pci_data {
static void acpi_pci_data_handler(acpi_handle handle, u32 function,
void *context)
{
- ACPI_FUNCTION_TRACE("acpi_pci_data_handler");
-
/* TBD: Anything we need to do here? */
- return_VOID;
}
/**
@@ -68,17 +65,15 @@ acpi_status acpi_get_pci_id(acpi_handle
struct acpi_device *device = NULL;
struct acpi_pci_data *data = NULL;
- ACPI_FUNCTION_TRACE("acpi_get_pci_id");
-
if (!id)
- return_ACPI_STATUS(AE_BAD_PARAMETER);
+ return AE_BAD_PARAMETER;
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_ERROR((AE_INFO,
"Invalid ACPI Bus context for device %s",
acpi_device_bid(device)));
- return_ACPI_STATUS(AE_NOT_EXIST);
+ return AE_NOT_EXIST;
}
status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data);
@@ -86,7 +81,7 @@ acpi_status acpi_get_pci_id(acpi_handle
ACPI_EXCEPTION((AE_INFO, status,
"Invalid ACPI-PCI context for device %s",
acpi_device_bid(device)));
- return_ACPI_STATUS(status);
+ return status;
}
*id = data->id;
@@ -103,7 +98,7 @@ acpi_status acpi_get_pci_id(acpi_handle
acpi_device_bid(device), id->segment, id->bus,
id->device, id->function));
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
EXPORT_SYMBOL(acpi_get_pci_id);
@@ -120,14 +115,12 @@ int acpi_pci_bind(struct acpi_device *de
struct pci_dev *dev;
struct pci_bus *bus;
- ACPI_FUNCTION_TRACE("acpi_pci_bind");
-
if (!device || !device->parent)
- return_VALUE(-EINVAL);
+ return -EINVAL;
pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX);
buffer.length = ACPI_PATHNAME_MAX;
buffer.pointer = pathname;
@@ -135,7 +128,7 @@ int acpi_pci_bind(struct acpi_device *de
data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
if (!data) {
kfree(pathname);
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
}
memset(data, 0, sizeof(struct acpi_pci_data));
@@ -269,7 +262,7 @@ int acpi_pci_bind(struct acpi_device *de
if (result)
kfree(data);
- return_VALUE(result);
+ return result;
}
int acpi_pci_unbind(struct acpi_device *device)
@@ -280,14 +273,12 @@ int acpi_pci_unbind(struct acpi_device *
char *pathname = NULL;
struct acpi_buffer buffer = { 0, NULL };
- ACPI_FUNCTION_TRACE("acpi_pci_unbind");
-
if (!device || !device->parent)
- return_VALUE(-EINVAL);
+ return -EINVAL;
pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX);
buffer.length = ACPI_PATHNAME_MAX;
@@ -322,7 +313,7 @@ int acpi_pci_unbind(struct acpi_device *
kfree(data);
end:
- return_VALUE(result);
+ return result;
}
int
@@ -335,11 +326,9 @@ acpi_pci_bind_root(struct acpi_device *d
char *pathname = NULL;
struct acpi_buffer buffer = { 0, NULL };
- ACPI_FUNCTION_TRACE("acpi_pci_bind_root");
-
pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX);
buffer.length = ACPI_PATHNAME_MAX;
@@ -347,13 +336,13 @@ acpi_pci_bind_root(struct acpi_device *d
if (!device || !id || !bus) {
kfree(pathname);
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
if (!data) {
kfree(pathname);
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
}
memset(data, 0, sizeof(struct acpi_pci_data));
@@ -381,5 +370,5 @@ acpi_pci_bind_root(struct acpi_device *d
if (result != 0)
kfree(data);
- return_VALUE(result);
+ return result;
}
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 14/24] Remove unneeded debugging macros in drivers/acpi/pci_irq.c
2006-04-18 1:21 ` [PATCH 13/24] Remove unneeded debugging macros in drivers/acpi/pci_bind.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 15/24] Remove unneeded debugging macros in drivers/acpi/pci_link.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/pci_irq.c | 72 ++++++++++++++++++------------------------------
1 files changed, 27 insertions(+), 45 deletions(-)
applies-to: a00ab78b8bcab09c3d99811aa5e191da2026aea1
fb4fe7cf714659783f58ea8512d458f92ccc2a58
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 4cabc51..f8ceab6 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -55,8 +55,6 @@ static struct acpi_prt_entry *acpi_pci_i
struct list_head *node = NULL;
struct acpi_prt_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry");
-
if (!acpi_prt.count)
return_PTR(NULL);
@@ -87,14 +85,12 @@ acpi_pci_irq_add_entry(acpi_handle handl
{
struct acpi_prt_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_pci_irq_add_entry");
-
if (!prt)
- return_VALUE(-EINVAL);
+ return -EINVAL;
entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);
if (!entry)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(entry, 0, sizeof(struct acpi_prt_entry));
entry->id.segment = segment;
@@ -141,7 +137,7 @@ acpi_pci_irq_add_entry(acpi_handle handl
acpi_prt.count++;
spin_unlock(&acpi_prt_lock);
- return_VALUE(0);
+ return 0;
}
static void
@@ -163,11 +159,9 @@ int acpi_pci_irq_add_prt(acpi_handle han
struct acpi_pci_routing_table *entry = NULL;
static int first_time = 1;
- ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt");
-
pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX);
if (first_time) {
@@ -199,12 +193,12 @@ int acpi_pci_irq_add_prt(acpi_handle han
if (status != AE_BUFFER_OVERFLOW) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
acpi_format_exception(status)));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
prt = kmalloc(buffer.length, GFP_KERNEL);
if (!prt) {
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
}
memset(prt, 0, buffer.length);
buffer.pointer = prt;
@@ -214,7 +208,7 @@ int acpi_pci_irq_add_prt(acpi_handle han
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
acpi_format_exception(status)));
kfree(buffer.pointer);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
entry = prt;
@@ -227,7 +221,7 @@ int acpi_pci_irq_add_prt(acpi_handle han
kfree(prt);
- return_VALUE(0);
+ return 0;
}
void acpi_pci_irq_del_prt(int segment, int bus)
@@ -262,8 +256,6 @@ acpi_pci_allocate_irq(struct acpi_prt_en
{
int irq;
- ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq");
-
if (entry->link.handle) {
irq = acpi_pci_link_allocate_irq(entry->link.handle,
entry->link.index, triggering,
@@ -271,7 +263,7 @@ acpi_pci_allocate_irq(struct acpi_prt_en
if (irq < 0) {
ACPI_WARNING((AE_INFO,
"Invalid IRQ link routing entry"));
- return_VALUE(-1);
+ return -1;
}
} else {
irq = entry->link.index;
@@ -280,7 +272,7 @@ acpi_pci_allocate_irq(struct acpi_prt_en
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
- return_VALUE(irq);
+ return irq;
}
static int
@@ -289,13 +281,12 @@ acpi_pci_free_irq(struct acpi_prt_entry
{
int irq;
- ACPI_FUNCTION_TRACE("acpi_pci_free_irq");
if (entry->link.handle) {
irq = acpi_pci_link_free_irq(entry->link.handle);
} else {
irq = entry->link.index;
}
- return_VALUE(irq);
+ return irq;
}
/*
@@ -315,8 +306,6 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
int bus_nr = bus->number;
int ret;
- ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup");
-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Searching for PRT entry for %02x:%02x:%02x[%c]\n",
segment, bus_nr, device, ('A' + pin)));
@@ -324,11 +313,11 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin);
if (!entry) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n"));
- return_VALUE(-1);
+ return -1;
}
ret = func(entry, triggering, polarity, link);
- return_VALUE(ret);
+ return ret;
}
/*
@@ -346,10 +335,8 @@ acpi_pci_irq_derive(struct pci_dev *dev,
int irq = -1;
u8 bridge_pin = 0;
- ACPI_FUNCTION_TRACE("acpi_pci_irq_derive");
-
if (!dev)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/*
* Attempt to derive an IRQ for this device from a parent bridge's
@@ -366,7 +353,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No interrupt pin configured for device %s\n",
pci_name(bridge)));
- return_VALUE(-1);
+ return -1;
}
/* Pin is from 0 to 3 */
bridge_pin--;
@@ -381,13 +368,13 @@ acpi_pci_irq_derive(struct pci_dev *dev,
if (irq < 0) {
ACPI_WARNING((AE_INFO, "Unable to derive IRQ for device %s",
pci_name(dev)));
- return_VALUE(-1);
+ return -1;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n",
irq, pci_name(dev), pci_name(bridge)));
- return_VALUE(irq);
+ return irq;
}
/*
@@ -405,23 +392,21 @@ int acpi_pci_irq_enable(struct pci_dev *
char *link = NULL;
int rc;
- ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
-
if (!dev)
- return_VALUE(-EINVAL);
+ return -EINVAL;
pin = dev->pin;
if (!pin) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No interrupt pin configured for device %s\n",
pci_name(dev)));
- return_VALUE(0);
+ return 0;
}
pin--;
if (!dev->bus) {
ACPI_ERROR((AE_INFO, "Invalid (NULL) 'bus' field"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
/*
@@ -453,10 +438,10 @@ int acpi_pci_irq_enable(struct pci_dev *
printk(" - using IRQ %d\n", dev->irq);
acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE,
ACPI_ACTIVE_LOW);
- return_VALUE(0);
+ return 0;
} else {
printk("\n");
- return_VALUE(0);
+ return 0;
}
}
@@ -464,7 +449,7 @@ int acpi_pci_irq_enable(struct pci_dev *
if (rc < 0) {
printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
"to register GSI\n", pci_name(dev), ('A' + pin));
- return_VALUE(rc);
+ return rc;
}
dev->irq = rc;
@@ -478,7 +463,7 @@ int acpi_pci_irq_enable(struct pci_dev *
(triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
(polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
- return_VALUE(0);
+ return 0;
}
EXPORT_SYMBOL(acpi_pci_irq_enable);
@@ -495,14 +480,12 @@ void acpi_pci_irq_disable(struct pci_dev
int triggering = ACPI_LEVEL_SENSITIVE;
int polarity = ACPI_ACTIVE_LOW;
- ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
-
if (!dev || !dev->bus)
- return_VOID;
+ return;
pin = dev->pin;
if (!pin)
- return_VOID;
+ return;
pin--;
/*
@@ -520,7 +503,7 @@ void acpi_pci_irq_disable(struct pci_dev
&triggering, &polarity, NULL,
acpi_pci_free_irq);
if (gsi < 0)
- return_VOID;
+ return;
/*
* TBD: It might be worth clearing dev->irq by magic constant
@@ -532,5 +515,4 @@ void acpi_pci_irq_disable(struct pci_dev
acpi_unregister_gsi(gsi);
- return_VOID;
}
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 15/24] Remove unneeded debugging macros in drivers/acpi/pci_link.c
2006-04-18 1:21 ` [PATCH 14/24] Remove unneeded debugging macros in drivers/acpi/pci_irq.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 16/24] Remove unneeded debugging macros in drivers/acpi/pci_root.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/pci_link.c | 120 ++++++++++++++++++-----------------------------
1 files changed, 45 insertions(+), 75 deletions(-)
applies-to: f90c808ca530e4a808646669157e7de12de866c4
2e4b45abdc58e96acc0005335575ffc11a4a768b
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index d4ea9da..fbfe24e 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -106,17 +106,15 @@ acpi_pci_link_check_possible(struct acpi
struct acpi_pci_link *link = (struct acpi_pci_link *)context;
u32 i = 0;
- ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
-
switch (resource->type) {
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
case ACPI_RESOURCE_TYPE_IRQ:
{
struct acpi_resource_irq *p = &resource->data.irq;
if (!p || !p->interrupt_count) {
ACPI_WARNING((AE_INFO, "Blank IRQ resource"));
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
for (i = 0;
(i < p->interrupt_count
@@ -141,7 +139,7 @@ acpi_pci_link_check_possible(struct acpi
if (!p || !p->interrupt_count) {
ACPI_WARNING((AE_INFO,
"Blank EXT IRQ resource"));
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
for (i = 0;
(i < p->interrupt_count
@@ -161,33 +159,31 @@ acpi_pci_link_check_possible(struct acpi
}
default:
ACPI_ERROR((AE_INFO, "Resource is not an IRQ entry\n"));
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
- return_ACPI_STATUS(AE_CTRL_TERMINATE);
+ return AE_CTRL_TERMINATE;
}
static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
{
acpi_status status;
- ACPI_FUNCTION_TRACE("acpi_pci_link_get_possible");
-
if (!link)
- return_VALUE(-EINVAL);
+ return -EINVAL;
status = acpi_walk_resources(link->handle, METHOD_NAME__PRS,
acpi_pci_link_check_possible, link);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Found %d possible IRQs\n",
link->irq.possible_count));
- return_VALUE(0);
+ return 0;
}
static acpi_status
@@ -195,8 +191,6 @@ acpi_pci_link_check_current(struct acpi_
{
int *irq = (int *)context;
- ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");
-
switch (resource->type) {
case ACPI_RESOURCE_TYPE_IRQ:
{
@@ -208,7 +202,7 @@ acpi_pci_link_check_current(struct acpi_
*/
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Blank IRQ resource\n"));
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
*irq = p->interrupts[0];
break;
@@ -224,7 +218,7 @@ acpi_pci_link_check_current(struct acpi_
*/
ACPI_WARNING((AE_INFO,
"Blank EXT IRQ resource"));
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
*irq = p->interrupts[0];
break;
@@ -233,9 +227,9 @@ acpi_pci_link_check_current(struct acpi_
default:
ACPI_ERROR((AE_INFO, "Resource %d isn't an IRQ", resource->type));
case ACPI_RESOURCE_TYPE_END_TAG:
- return_ACPI_STATUS(AE_OK);
+ return AE_OK;
}
- return_ACPI_STATUS(AE_CTRL_TERMINATE);
+ return AE_CTRL_TERMINATE;
}
/*
@@ -251,10 +245,8 @@ static int acpi_pci_link_get_current(str
acpi_status status = AE_OK;
int irq = 0;
- ACPI_FUNCTION_TRACE("acpi_pci_link_get_current");
-
if (!link || !link->handle)
- return_VALUE(-EINVAL);
+ return -EINVAL;
link->irq.active = 0;
@@ -269,7 +261,7 @@ static int acpi_pci_link_get_current(str
if (!link->device->status.enabled) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n"));
- return_VALUE(0);
+ return 0;
}
}
@@ -295,7 +287,7 @@ static int acpi_pci_link_get_current(str
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active));
end:
- return_VALUE(result);
+ return result;
}
static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
@@ -308,14 +300,12 @@ static int acpi_pci_link_set(struct acpi
} *resource;
struct acpi_buffer buffer = { 0, NULL };
- ACPI_FUNCTION_TRACE("acpi_pci_link_set");
-
if (!link || !irq)
- return_VALUE(-EINVAL);
+ return -EINVAL;
resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
if (!resource)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(resource, 0, sizeof(*resource) + 1);
buffer.length = sizeof(*resource) + 1;
@@ -412,7 +402,7 @@ static int acpi_pci_link_set(struct acpi
end:
kfree(resource);
- return_VALUE(result);
+ return result;
}
/* --------------------------------------------------------------------------
@@ -486,8 +476,6 @@ int __init acpi_irq_penalty_init(void)
struct acpi_pci_link *link = NULL;
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_irq_penalty_init");
-
/*
* Update penalties to facilitate IRQ balancing.
*/
@@ -523,7 +511,7 @@ int __init acpi_irq_penalty_init(void)
/* Add a penalty for the SCI */
acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING;
- return_VALUE(0);
+ return 0;
}
static int acpi_irq_balance; /* 0: static, 1: balance */
@@ -533,13 +521,11 @@ static int acpi_pci_link_allocate(struct
int irq;
int i;
- ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
-
if (link->irq.initialized) {
if (link->refcnt == 0)
/* This means the link is disabled but initialized */
acpi_pci_link_set(link, link->irq.active);
- return_VALUE(0);
+ return 0;
}
/*
@@ -586,7 +572,7 @@ static int acpi_pci_link_allocate(struct
"Try pci=noacpi or acpi=off",
acpi_device_name(link->device),
acpi_device_bid(link->device)));
- return_VALUE(-ENODEV);
+ return -ENODEV;
} else {
acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
printk(PREFIX "%s [%s] enabled at IRQ %d\n",
@@ -596,7 +582,7 @@ static int acpi_pci_link_allocate(struct
link->irq.initialized = 1;
- return_VALUE(0);
+ return 0;
}
/*
@@ -614,36 +600,34 @@ acpi_pci_link_allocate_irq(acpi_handle h
struct acpi_device *device = NULL;
struct acpi_pci_link *link = NULL;
- ACPI_FUNCTION_TRACE("acpi_pci_link_allocate_irq");
-
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_ERROR((AE_INFO, "Invalid link device"));
- return_VALUE(-1);
+ return -1;
}
link = (struct acpi_pci_link *)acpi_driver_data(device);
if (!link) {
ACPI_ERROR((AE_INFO, "Invalid link context"));
- return_VALUE(-1);
+ return -1;
}
/* TBD: Support multiple index (IRQ) entries per Link Device */
if (index) {
ACPI_ERROR((AE_INFO, "Invalid index %d", index));
- return_VALUE(-1);
+ return -1;
}
down(&acpi_link_lock);
if (acpi_pci_link_allocate(link)) {
up(&acpi_link_lock);
- return_VALUE(-1);
+ return -1;
}
if (!link->irq.active) {
up(&acpi_link_lock);
ACPI_ERROR((AE_INFO, "Link active IRQ is 0!"));
- return_VALUE(-1);
+ return -1;
}
link->refcnt++;
up(&acpi_link_lock);
@@ -657,7 +641,7 @@ acpi_pci_link_allocate_irq(acpi_handle h
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Link %s is referenced\n",
acpi_device_bid(link->device)));
- return_VALUE(link->irq.active);
+ return link->irq.active;
}
/*
@@ -670,25 +654,23 @@ int acpi_pci_link_free_irq(acpi_handle h
struct acpi_pci_link *link = NULL;
acpi_status result;
- ACPI_FUNCTION_TRACE("acpi_pci_link_free_irq");
-
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_ERROR((AE_INFO, "Invalid link device"));
- return_VALUE(-1);
+ return -1;
}
link = (struct acpi_pci_link *)acpi_driver_data(device);
if (!link) {
ACPI_ERROR((AE_INFO, "Invalid link context"));
- return_VALUE(-1);
+ return -1;
}
down(&acpi_link_lock);
if (!link->irq.initialized) {
up(&acpi_link_lock);
ACPI_ERROR((AE_INFO, "Link isn't initialized"));
- return_VALUE(-1);
+ return -1;
}
#ifdef FUTURE_USE
/*
@@ -710,7 +692,7 @@ int acpi_pci_link_free_irq(acpi_handle h
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
}
up(&acpi_link_lock);
- return_VALUE(link->irq.active);
+ return link->irq.active;
}
/* --------------------------------------------------------------------------
@@ -724,14 +706,12 @@ static int acpi_pci_link_add(struct acpi
int i = 0;
int found = 0;
- ACPI_FUNCTION_TRACE("acpi_pci_link_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL);
if (!link)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(link, 0, sizeof(struct acpi_pci_link));
link->device = device;
@@ -780,17 +760,15 @@ static int acpi_pci_link_add(struct acpi
if (result)
kfree(link);
- return_VALUE(result);
+ return result;
}
static int acpi_pci_link_resume(struct acpi_pci_link *link)
{
- ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
-
if (link->refcnt && link->irq.active && link->irq.initialized)
- return_VALUE(acpi_pci_link_set(link, link->irq.active));
+ return acpi_pci_link_set(link, link->irq.active);
else
- return_VALUE(0);
+ return 0;
}
/*
@@ -803,8 +781,6 @@ static int irqrouter_resume(struct sys_d
struct list_head *node = NULL;
struct acpi_pci_link *link = NULL;
- ACPI_FUNCTION_TRACE("irqrouter_resume");
-
acpi_in_resume = 1;
list_for_each(node, &acpi_link.entries) {
link = list_entry(node, struct acpi_pci_link, node);
@@ -815,17 +791,15 @@ static int irqrouter_resume(struct sys_d
acpi_pci_link_resume(link);
}
acpi_in_resume = 0;
- return_VALUE(0);
+ return 0;
}
static int acpi_pci_link_remove(struct acpi_device *device, int type)
{
struct acpi_pci_link *link = NULL;
- ACPI_FUNCTION_TRACE("acpi_pci_link_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
link = (struct acpi_pci_link *)acpi_driver_data(device);
@@ -835,7 +809,7 @@ static int acpi_pci_link_remove(struct a
kfree(link);
- return_VALUE(0);
+ return 0;
}
/*
@@ -941,34 +915,30 @@ static int __init irqrouter_init_sysfs(v
{
int error;
- ACPI_FUNCTION_TRACE("irqrouter_init_sysfs");
-
if (acpi_disabled || acpi_noirq)
- return_VALUE(0);
+ return 0;
error = sysdev_class_register(&irqrouter_sysdev_class);
if (!error)
error = sysdev_register(&device_irqrouter);
- return_VALUE(error);
+ return error;
}
device_initcall(irqrouter_init_sysfs);
static int __init acpi_pci_link_init(void)
{
- ACPI_FUNCTION_TRACE("acpi_pci_link_init");
-
if (acpi_noirq)
- return_VALUE(0);
+ return 0;
acpi_link.count = 0;
INIT_LIST_HEAD(&acpi_link.entries);
if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0)
- return_VALUE(-ENODEV);
+ return -ENODEV;
- return_VALUE(0);
+ return 0;
}
subsys_initcall(acpi_pci_link_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 20/24] Remove unneeded debugging macros in drivers/acpi/processor_perflib.c
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
2006-04-18 1:21 ` [PATCH 21/24] Remove unneeded debugging macros in drivers/acpi/processor_thermal.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
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
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 19/24] Remove unneeded debugging macros in drivers/acpi/processor_idle.c
2006-04-18 1:21 ` [PATCH 18/24] Remove unneeded debugging macros in drivers/acpi/processor_core.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 20/24] Remove unneeded debugging macros in drivers/acpi/processor_perflib.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/processor_idle.c | 80 ++++++++++++++---------------------------
1 files changed, 28 insertions(+), 52 deletions(-)
applies-to: a950fd29a26cf294c2e4de46d8d1f89d6feec874
c00c2a68335e667033330b863c256f3b90f3fb29
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 5b72cc9..5ccce5a 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -508,10 +508,8 @@ static int acpi_processor_set_power_poli
struct acpi_processor_cx *higher = NULL;
struct acpi_processor_cx *cx;
- ACPI_FUNCTION_TRACE("acpi_processor_set_power_policy");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/*
* This function sets the default Cx state policy (OS idle handler).
@@ -535,7 +533,7 @@ static int acpi_processor_set_power_poli
}
if (!state_is_set)
- return_VALUE(-ENODEV);
+ return -ENODEV;
/* demotion */
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
@@ -574,18 +572,16 @@ static int acpi_processor_set_power_poli
higher = cx;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
{
- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!pr->pblk)
- return_VALUE(-ENODEV);
+ return -ENODEV;
/* if info is obtained from pblk/fadt, type equals state */
pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
@@ -597,7 +593,7 @@ static int acpi_processor_get_power_info
* an SMP system.
*/
if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
- return_VALUE(-ENODEV);
+ return -ENODEV;
#endif
/* determine C2 and C3 address from pblk */
@@ -613,13 +609,11 @@ static int acpi_processor_get_power_info
pr->power.states[ACPI_STATE_C2].address,
pr->power.states[ACPI_STATE_C3].address));
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
{
- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
-
/* Zero initialize all the C-states info. */
memset(pr->power.states, 0, sizeof(pr->power.states));
@@ -631,7 +625,7 @@ static int acpi_processor_get_power_info
pr->power.states[ACPI_STATE_C0].valid = 1;
pr->power.states[ACPI_STATE_C1].valid = 1;
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
@@ -643,10 +637,8 @@ static int acpi_processor_get_power_info
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *cst;
- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_cst");
-
if (nocst)
- return_VALUE(-ENODEV);
+ return -ENODEV;
current_count = 1;
@@ -658,7 +650,7 @@ static int acpi_processor_get_power_info
status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
cst = (union acpi_object *)buffer.pointer;
@@ -764,15 +756,13 @@ static int acpi_processor_get_power_info
end:
acpi_os_free(buffer.pointer);
- return_VALUE(status);
+ return status;
}
static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
{
- ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c2");
-
if (!cx->address)
- return_VOID;
+ return;
/*
* C2 latency must be less than or equal to 100
@@ -781,7 +771,7 @@ static void acpi_processor_power_verify_
else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"latency too large [%d]\n", cx->latency));
- return_VOID;
+ return;
}
/*
@@ -791,7 +781,6 @@ static void acpi_processor_power_verify_
cx->valid = 1;
cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
- return_VOID;
}
static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
@@ -799,10 +788,8 @@ static void acpi_processor_power_verify_
{
static int bm_check_flag;
- ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c3");
-
if (!cx->address)
- return_VOID;
+ return;
/*
* C3 latency must be less than or equal to 1000
@@ -811,7 +798,7 @@ static void acpi_processor_power_verify_
else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"latency too large [%d]\n", cx->latency));
- return_VOID;
+ return;
}
/*
@@ -824,7 +811,7 @@ static void acpi_processor_power_verify_
else if (errata.piix4.fdma) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 not supported on PIIX4 with Type-F DMA\n"));
- return_VOID;
+ return;
}
/* All the logic here assumes flags.bm_check is same across all CPUs */
@@ -841,7 +828,7 @@ static void acpi_processor_power_verify_
if (!pr->flags.bm_control) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 support requires bus mastering control\n"));
- return_VOID;
+ return;
}
} else {
/*
@@ -852,7 +839,7 @@ static void acpi_processor_power_verify_
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Cache invalidation should work properly"
" for C3 to be enabled on SMP systems\n"));
- return_VOID;
+ return;
}
acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD,
0, ACPI_MTX_DO_NOT_LOCK);
@@ -867,7 +854,6 @@ static void acpi_processor_power_verify_
cx->valid = 1;
cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
- return_VOID;
}
static int acpi_processor_power_verify(struct acpi_processor *pr)
@@ -926,8 +912,6 @@ static int acpi_processor_get_power_info
unsigned int i;
int result;
- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info");
-
/* NOTE: the idle thread may not be running while calling
* this function */
@@ -949,7 +933,7 @@ static int acpi_processor_get_power_info
*/
result = acpi_processor_set_power_policy(pr);
if (result)
- return_VALUE(result);
+ return result;
/*
* if one state of type C2 or C3 is available, mark this
@@ -963,24 +947,22 @@ static int acpi_processor_get_power_info
}
}
- return_VALUE(0);
+ return 0;
}
int acpi_processor_cst_has_changed(struct acpi_processor *pr)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_cst_has_changed");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (nocst) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
if (!pr->flags.power_setup_done)
- return_VALUE(-ENODEV);
+ return -ENODEV;
/* Fall back to the default idle loop */
pm_idle = pm_idle_save;
@@ -991,7 +973,7 @@ int acpi_processor_cst_has_changed(struc
if ((pr->flags.power == 1) && (pr->flags.power_setup_done))
pm_idle = acpi_processor_idle;
- return_VALUE(result);
+ return result;
}
/* proc interface */
@@ -1001,8 +983,6 @@ static int acpi_processor_power_seq_show
struct acpi_processor *pr = (struct acpi_processor *)seq->private;
unsigned int i;
- ACPI_FUNCTION_TRACE("acpi_processor_power_seq_show");
-
if (!pr)
goto end;
@@ -1059,7 +1039,7 @@ static int acpi_processor_power_seq_show
}
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
@@ -1083,8 +1063,6 @@ int acpi_processor_power_init(struct acp
struct proc_dir_entry *entry = NULL;
unsigned int i;
- ACPI_FUNCTION_TRACE("acpi_processor_power_init");
-
if (!first_run) {
dmi_check_system(processor_power_dmi_table);
if (max_cstate < ACPI_C_STATES_MAX)
@@ -1095,7 +1073,7 @@ int acpi_processor_power_init(struct acp
}
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (acpi_fadt.cst_cnt && !nocst) {
status =
@@ -1140,14 +1118,12 @@ int acpi_processor_power_init(struct acp
pr->flags.power_setup_done = 1;
- return_VALUE(0);
+ return 0;
}
int acpi_processor_power_exit(struct acpi_processor *pr,
struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_processor_power_exit");
-
pr->flags.power_setup_done = 0;
if (acpi_device_dir(device))
@@ -1166,5 +1142,5 @@ int acpi_processor_power_exit(struct acp
cpu_idle_wait();
}
- return_VALUE(0);
+ return 0;
}
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 24/24] Remove unneeded debugging macros in drivers/acpi/thermal.c
2006-04-18 1:21 ` [PATCH 23/24] Remove unneeded debugging macros in drivers/acpi/system.c mochel
@ 2006-04-18 1:21 ` mochel
0 siblings, 0 replies; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/thermal.c | 195 +++++++++++++++++-------------------------------
1 files changed, 68 insertions(+), 127 deletions(-)
applies-to: a4c30af519d8362f7b24bb5f7f87f4946383e1f5
3944e854ecd6c583395c26abd83c66ad1da0c31d
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 4829f06..db3bef1 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -220,51 +220,45 @@ static int acpi_thermal_get_temperature(
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("acpi_thermal_get_temperature");
-
if (!tz)
- return_VALUE(-EINVAL);
+ return -EINVAL;
tz->last_temperature = tz->temperature;
status =
acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n",
tz->temperature));
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("acpi_thermal_get_polling_frequency");
-
if (!tz)
- return_VALUE(-EINVAL);
+ return -EINVAL;
status =
acpi_evaluate_integer(tz->handle, "_TZP", NULL,
&tz->polling_frequency);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n",
tz->polling_frequency));
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds)
{
- ACPI_FUNCTION_TRACE("acpi_thermal_set_polling");
-
if (!tz)
- return_VALUE(-EINVAL);
+ return -EINVAL;
tz->polling_frequency = seconds * 10; /* Convert value to deci-seconds */
@@ -272,7 +266,7 @@ static int acpi_thermal_set_polling(stru
"Polling frequency set to %lu seconds\n",
tz->polling_frequency));
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
@@ -282,29 +276,27 @@ static int acpi_thermal_set_cooling_mode
struct acpi_object_list arg_list = { 1, &arg0 };
acpi_handle handle = NULL;
- ACPI_FUNCTION_TRACE("acpi_thermal_set_cooling_mode");
-
if (!tz)
- return_VALUE(-EINVAL);
+ return -EINVAL;
status = acpi_get_handle(tz->handle, "_SCP", &handle);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
arg0.integer.value = mode;
status = acpi_evaluate_object(handle, NULL, &arg_list, NULL);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
tz->cooling_mode = mode;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n",
mode ? "passive" : "active"));
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
@@ -312,10 +304,8 @@ static int acpi_thermal_get_trip_points(
acpi_status status = AE_OK;
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_get_trip_points");
-
if (!tz)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* Critical Shutdown (required) */
@@ -324,7 +314,7 @@ static int acpi_thermal_get_trip_points(
if (ACPI_FAILURE(status)) {
tz->trips.critical.flags.valid = 0;
ACPI_EXCEPTION((AE_INFO, status, "No critical threshold"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
} else {
tz->trips.critical.flags.valid = 1;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -415,24 +405,22 @@ static int acpi_thermal_get_trip_points(
"Invalid active threshold [%d]", i));
}
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_get_devices(struct acpi_thermal *tz)
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("acpi_thermal_get_devices");
-
if (!tz)
- return_VALUE(-EINVAL);
+ return -EINVAL;
status =
acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_call_usermode(char *path)
@@ -440,10 +428,8 @@ static int acpi_thermal_call_usermode(ch
char *argv[2] = { NULL, NULL };
char *envp[3] = { NULL, NULL, NULL };
- ACPI_FUNCTION_TRACE("acpi_thermal_call_usermode");
-
if (!path)
- return_VALUE(-EINVAL);
+ return -EINVAL;
argv[0] = path;
@@ -453,7 +439,7 @@ static int acpi_thermal_call_usermode(ch
call_usermodehelper(argv[0], argv, envp, 0);
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_critical(struct acpi_thermal *tz)
@@ -461,10 +447,8 @@ static int acpi_thermal_critical(struct
int result = 0;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_thermal_critical");
-
if (!tz || !tz->trips.critical.flags.valid)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (tz->temperature >= tz->trips.critical.temperature) {
ACPI_WARNING((AE_INFO, "Critical trip point"));
@@ -474,7 +458,7 @@ static int acpi_thermal_critical(struct
result = acpi_bus_get_device(tz->handle, &device);
if (result)
- return_VALUE(result);
+ return result;
printk(KERN_EMERG
"Critical temperature reached (%ld C), shutting down.\n",
@@ -484,7 +468,7 @@ static int acpi_thermal_critical(struct
acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_hot(struct acpi_thermal *tz)
@@ -492,10 +476,8 @@ static int acpi_thermal_hot(struct acpi_
int result = 0;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_thermal_hot");
-
if (!tz || !tz->trips.hot.flags.valid)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (tz->temperature >= tz->trips.hot.temperature) {
ACPI_WARNING((AE_INFO, "Hot trip point"));
@@ -505,14 +487,14 @@ static int acpi_thermal_hot(struct acpi_
result = acpi_bus_get_device(tz->handle, &device);
if (result)
- return_VALUE(result);
+ return result;
acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT,
tz->trips.hot.flags.enabled);
/* TBD: Call user-mode "sleep(S4)" function */
- return_VALUE(0);
+ return 0;
}
static void acpi_thermal_passive(struct acpi_thermal *tz)
@@ -522,8 +504,6 @@ static void acpi_thermal_passive(struct
int trend = 0;
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_passive");
-
if (!tz || !tz->trips.passive.flags.valid)
return;
@@ -611,8 +591,6 @@ static void acpi_thermal_active(struct a
int j = 0;
unsigned long maxtemp = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_active");
-
if (!tz)
return;
@@ -694,18 +672,16 @@ static void acpi_thermal_check(void *dat
int i = 0;
struct acpi_thermal_state state;
- ACPI_FUNCTION_TRACE("acpi_thermal_check");
-
if (!tz) {
ACPI_ERROR((AE_INFO, "Invalid (NULL) context"));
- return_VOID;
+ return;
}
state = tz->state;
result = acpi_thermal_get_temperature(tz);
if (result)
- return_VOID;
+ return;
memset(&tz->state, 0, sizeof(tz->state));
@@ -794,7 +770,6 @@ static void acpi_thermal_check(void *dat
}
}
- return_VOID;
}
/* --------------------------------------------------------------------------
@@ -807,8 +782,6 @@ static int acpi_thermal_state_seq_show(s
{
struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_thermal_state_seq_show");
-
if (!tz)
goto end;
@@ -830,7 +803,7 @@ static int acpi_thermal_state_seq_show(s
}
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file)
@@ -843,8 +816,6 @@ static int acpi_thermal_temp_seq_show(st
int result = 0;
struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_thermal_temp_seq_show");
-
if (!tz)
goto end;
@@ -856,7 +827,7 @@ static int acpi_thermal_temp_seq_show(st
KELVIN_TO_CELSIUS(tz->temperature));
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
@@ -870,8 +841,6 @@ static int acpi_thermal_trip_seq_show(st
int i = 0;
int j = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_trip_seq_show");
-
if (!tz)
goto end;
@@ -910,7 +879,7 @@ static int acpi_thermal_trip_seq_show(st
}
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file)
@@ -931,18 +900,16 @@ acpi_thermal_write_trip_points(struct fi
int *active;
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points");
-
limit_string = kmalloc(ACPI_THERMAL_MAX_LIMIT_STR_LEN, GFP_KERNEL);
if (!limit_string)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
if (!active) {
kfree(limit_string);
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
}
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
@@ -979,15 +946,13 @@ acpi_thermal_write_trip_points(struct fi
end:
kfree(active);
kfree(limit_string);
- return_VALUE(count);
+ return count;
}
static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_thermal_cooling_seq_show");
-
if (!tz)
goto end;
@@ -1002,7 +967,7 @@ static int acpi_thermal_cooling_seq_show
tz->cooling_mode ? "passive" : "active");
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file)
@@ -1021,16 +986,14 @@ acpi_thermal_write_cooling_mode(struct f
int result = 0;
char mode_string[12] = { '\0' };
- ACPI_FUNCTION_TRACE("acpi_thermal_write_cooling_mode");
-
if (!tz || (count > sizeof(mode_string) - 1))
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!tz->flags.cooling_mode)
- return_VALUE(-ENODEV);
+ return -ENODEV;
if (copy_from_user(mode_string, buffer, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
mode_string[count] = '\0';
@@ -1038,19 +1001,17 @@ acpi_thermal_write_cooling_mode(struct f
simple_strtoul(mode_string, NULL,
0));
if (result)
- return_VALUE(result);
+ return result;
acpi_thermal_check(tz);
- return_VALUE(count);
+ return count;
}
static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_thermal_polling_seq_show");
-
if (!tz)
goto end;
@@ -1063,7 +1024,7 @@ static int acpi_thermal_polling_seq_show
(tz->polling_frequency / 10));
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file)
@@ -1083,13 +1044,11 @@ acpi_thermal_write_polling(struct file *
char polling_string[12] = { '\0' };
int seconds = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_write_polling");
-
if (!tz || (count > sizeof(polling_string) - 1))
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (copy_from_user(polling_string, buffer, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
polling_string[count] = '\0';
@@ -1097,24 +1056,22 @@ acpi_thermal_write_polling(struct file *
result = acpi_thermal_set_polling(tz, seconds);
if (result)
- return_VALUE(result);
+ return result;
acpi_thermal_check(tz);
- return_VALUE(count);
+ return count;
}
static int acpi_thermal_add_fs(struct acpi_device *device)
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_thermal_add_fs");
-
if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_thermal_dir);
if (!acpi_device_dir(device))
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE;
}
@@ -1122,7 +1079,7 @@ static int acpi_thermal_add_fs(struct ac
entry = create_proc_entry(ACPI_THERMAL_FILE_STATE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_thermal_state_fops;
entry->data = acpi_driver_data(device);
@@ -1133,7 +1090,7 @@ static int acpi_thermal_add_fs(struct ac
entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_thermal_temp_fops;
entry->data = acpi_driver_data(device);
@@ -1145,7 +1102,7 @@ static int acpi_thermal_add_fs(struct ac
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_thermal_trip_fops;
entry->data = acpi_driver_data(device);
@@ -1157,7 +1114,7 @@ static int acpi_thermal_add_fs(struct ac
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_thermal_cooling_fops;
entry->data = acpi_driver_data(device);
@@ -1169,20 +1126,18 @@ static int acpi_thermal_add_fs(struct ac
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- return_VALUE(-ENODEV);
+ return -ENODEV;
else {
entry->proc_fops = &acpi_thermal_polling_fops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_remove_fs(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs");
-
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ,
acpi_device_dir(device));
@@ -1198,7 +1153,7 @@ static int acpi_thermal_remove_fs(struct
acpi_device_dir(device) = NULL;
}
- return_VALUE(0);
+ return 0;
}
/* --------------------------------------------------------------------------
@@ -1210,13 +1165,11 @@ static void acpi_thermal_notify(acpi_han
struct acpi_thermal *tz = (struct acpi_thermal *)data;
struct acpi_device *device = NULL;
- ACPI_FUNCTION_TRACE("acpi_thermal_notify");
-
if (!tz)
- return_VOID;
+ return;
if (acpi_bus_get_device(tz->handle, &device))
- return_VOID;
+ return;
switch (event) {
case ACPI_THERMAL_NOTIFY_TEMPERATURE:
@@ -1238,27 +1191,24 @@ static void acpi_thermal_notify(acpi_han
break;
}
- return_VOID;
}
static int acpi_thermal_get_info(struct acpi_thermal *tz)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_get_info");
-
if (!tz)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* Get temperature [_TMP] (required) */
result = acpi_thermal_get_temperature(tz);
if (result)
- return_VALUE(result);
+ return result;
/* Get trip points [_CRT, _PSV, etc.] (required) */
result = acpi_thermal_get_trip_points(tz);
if (result)
- return_VALUE(result);
+ return result;
/* Set the cooling mode [_SCP] to active cooling (default) */
result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
@@ -1298,7 +1248,7 @@ static int acpi_thermal_get_info(struct
if (!result)
tz->flags.devices = 1;
- return_VALUE(0);
+ return 0;
}
static int acpi_thermal_add(struct acpi_device *device)
@@ -1307,14 +1257,12 @@ static int acpi_thermal_add(struct acpi_
acpi_status status = AE_OK;
struct acpi_thermal *tz = NULL;
- ACPI_FUNCTION_TRACE("acpi_thermal_add");
-
if (!device)
- return_VALUE(-EINVAL);
+ return -EINVAL;
tz = kmalloc(sizeof(struct acpi_thermal), GFP_KERNEL);
if (!tz)
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
memset(tz, 0, sizeof(struct acpi_thermal));
tz->handle = device->handle;
@@ -1329,7 +1277,7 @@ static int acpi_thermal_add(struct acpi_
result = acpi_thermal_add_fs(device);
if (result)
- return_VALUE(result);
+ return result;
init_timer(&tz->timer);
@@ -1353,7 +1301,7 @@ static int acpi_thermal_add(struct acpi_
kfree(tz);
}
- return_VALUE(result);
+ return result;
}
static int acpi_thermal_remove(struct acpi_device *device, int type)
@@ -1361,10 +1309,8 @@ static int acpi_thermal_remove(struct ac
acpi_status status = AE_OK;
struct acpi_thermal *tz = NULL;
- ACPI_FUNCTION_TRACE("acpi_thermal_remove");
-
if (!device || !acpi_driver_data(device))
- return_VALUE(-EINVAL);
+ return -EINVAL;
tz = (struct acpi_thermal *)acpi_driver_data(device);
@@ -1395,38 +1341,33 @@ static int acpi_thermal_remove(struct ac
acpi_thermal_remove_fs(device);
kfree(tz);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_thermal_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_thermal_init");
-
acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);
if (!acpi_thermal_dir)
- return_VALUE(-ENODEV);
+ return -ENODEV;
acpi_thermal_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_thermal_driver);
if (result < 0) {
remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_thermal_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_thermal_exit");
-
acpi_bus_unregister_driver(&acpi_thermal_driver);
remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
- return_VOID;
}
module_init(acpi_thermal_init);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 23/24] Remove unneeded debugging macros in drivers/acpi/system.c
2006-04-18 1:21 ` [PATCH 22/24] Remove unneeded debugging macros in drivers/acpi/processor_throttling.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 24/24] Remove unneeded debugging macros in drivers/acpi/thermal.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/system.c | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
applies-to: f8fdada61595438918dc97c6bf561166cea7c47e
31a4eaa3ee9730e2af763e09d6c90bc13abfb70c
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index bcbfcb1..f705386 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -47,10 +47,8 @@ extern FADT_DESCRIPTOR acpi_fadt;
static int acpi_system_read_info(struct seq_file *seq, void *offset)
{
- ACPI_FUNCTION_TRACE("acpi_system_read_info");
-
seq_printf(seq, "version: %x\n", ACPI_CA_VERSION);
- return_VALUE(0);
+ return 0;
}
static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
@@ -80,17 +78,15 @@ acpi_system_read_dsdt(struct file *file,
struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
ssize_t res;
- ACPI_FUNCTION_TRACE("acpi_system_read_dsdt");
-
status = acpi_get_table(ACPI_TABLE_DSDT, 1, &dsdt);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
res = simple_read_from_buffer(buffer, count, ppos,
dsdt.pointer, dsdt.length);
acpi_os_free(dsdt.pointer);
- return_VALUE(res);
+ return res;
}
static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
@@ -108,17 +104,15 @@ acpi_system_read_fadt(struct file *file,
struct acpi_buffer fadt = { ACPI_ALLOCATE_BUFFER, NULL };
ssize_t res;
- ACPI_FUNCTION_TRACE("acpi_system_read_fadt");
-
status = acpi_get_table(ACPI_TABLE_FADT, 1, &fadt);
if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
+ return -ENODEV;
res = simple_read_from_buffer(buffer, count, ppos,
fadt.pointer, fadt.length);
acpi_os_free(fadt.pointer);
- return_VALUE(res);
+ return res;
}
static int __init acpi_system_init(void)
@@ -127,10 +121,8 @@ static int __init acpi_system_init(void)
int error = 0;
char *name;
- ACPI_FUNCTION_TRACE("acpi_system_init");
-
if (acpi_disabled)
- return_VALUE(0);
+ return 0;
/* 'info' [R] */
name = ACPI_SYSTEM_FILE_INFO;
@@ -158,7 +150,7 @@ static int __init acpi_system_init(void)
goto Error;
Done:
- return_VALUE(error);
+ return error;
Error:
remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 22/24] Remove unneeded debugging macros in drivers/acpi/processor_throttling.c
2006-04-18 1:21 ` [PATCH 21/24] Remove unneeded debugging macros in drivers/acpi/processor_thermal.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 23/24] Remove unneeded debugging macros in drivers/acpi/system.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
---
drivers/acpi/processor_throttling.c | 48 ++++++++++++++---------------------
1 files changed, 19 insertions(+), 29 deletions(-)
applies-to: a75363b5033310198c804b052b0ad35fd925b52c
72e80a7f3b6461863c98f982fac94801a71474cb
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 97856ad..6552e22 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -55,13 +55,11 @@ static int acpi_processor_get_throttling
u32 duty_mask = 0;
u32 duty_value = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_get_throttling");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!pr->flags.throttling)
- return_VALUE(-ENODEV);
+ return -ENODEV;
pr->throttling.state = 0;
@@ -93,7 +91,7 @@ static int acpi_processor_get_throttling
"Throttling state is T%d (%d%% throttling applied)\n",
state, pr->throttling.states[state].performance));
- return_VALUE(0);
+ return 0;
}
int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
@@ -102,19 +100,17 @@ int acpi_processor_set_throttling(struct
u32 duty_mask = 0;
u32 duty_value = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_set_throttling");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if ((state < 0) || (state > (pr->throttling.state_count - 1)))
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!pr->flags.throttling)
- return_VALUE(-ENODEV);
+ return -ENODEV;
if (state == pr->throttling.state)
- return_VALUE(0);
+ return 0;
/*
* Calculate the duty_value and duty_mask.
@@ -165,7 +161,7 @@ int acpi_processor_set_throttling(struct
(pr->throttling.states[state].performance ? pr->
throttling.states[state].performance / 10 : 0)));
- return_VALUE(0);
+ return 0;
}
int acpi_processor_get_throttling_info(struct acpi_processor *pr)
@@ -174,8 +170,6 @@ int acpi_processor_get_throttling_info(s
int step = 0;
int i = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_get_throttling_info");
-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
pr->throttling.address,
@@ -183,21 +177,21 @@ int acpi_processor_get_throttling_info(s
pr->throttling.duty_width));
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
/* TBD: Support ACPI 2.0 objects */
if (!pr->throttling.address) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
- return_VALUE(0);
+ return 0;
} else if (!pr->throttling.duty_width) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));
- return_VALUE(0);
+ return 0;
}
/* TBD: Support duty_cycle values that span bit 4. */
else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {
ACPI_WARNING((AE_INFO, "duty_cycle spans bit 4"));
- return_VALUE(0);
+ return 0;
}
/*
@@ -208,7 +202,7 @@ int acpi_processor_get_throttling_info(s
if (errata.piix4.throttle) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Throttling not supported on PIIX4 A- or B-step\n"));
- return_VALUE(0);
+ return 0;
}
pr->throttling.state_count = 1 << acpi_fadt.duty_width;
@@ -254,7 +248,7 @@ int acpi_processor_get_throttling_info(s
if (result)
pr->flags.throttling = 0;
- return_VALUE(result);
+ return result;
}
/* proc interface */
@@ -266,8 +260,6 @@ static int acpi_processor_throttling_seq
int i = 0;
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_throttling_seq_show");
-
if (!pr)
goto end;
@@ -296,7 +288,7 @@ static int acpi_processor_throttling_seq
throttling.states[i].performance / 10 : 0));
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_throttling_open_fs(struct inode *inode,
@@ -315,13 +307,11 @@ static ssize_t acpi_processor_write_thro
struct acpi_processor *pr = (struct acpi_processor *)m->private;
char state_string[12] = { '\0' };
- ACPI_FUNCTION_TRACE("acpi_processor_write_throttling");
-
if (!pr || (count > sizeof(state_string) - 1))
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (copy_from_user(state_string, buffer, count))
- return_VALUE(-EFAULT);
+ return -EFAULT;
state_string[count] = '\0';
@@ -329,9 +319,9 @@ static ssize_t acpi_processor_write_thro
simple_strtoul(state_string,
NULL, 0));
if (result)
- return_VALUE(result);
+ return result;
- return_VALUE(count);
+ return count;
}
struct file_operations acpi_processor_throttling_fops = {
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 21/24] Remove unneeded debugging macros in drivers/acpi/processor_thermal.c
2006-04-18 1:21 ` [PATCH 20/24] Remove unneeded debugging macros in drivers/acpi/processor_perflib.c mochel
@ 2006-04-18 1:21 ` mochel
2006-04-18 1:21 ` [PATCH 22/24] Remove unneeded debugging macros in drivers/acpi/processor_throttling.c mochel
0 siblings, 1 reply; 24+ messages in thread
From: mochel @ 2006-04-18 1:21 UTC (permalink / raw)
To: linux-acpi; +Cc: Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
---
drivers/acpi/processor_thermal.c | 42 ++++++++++++++------------------------
1 files changed, 16 insertions(+), 26 deletions(-)
applies-to: 72188ed0aa80350aa7d44e92d7d45257bda7c522
57c8be1f7b709b279845d1e4f6e50fd94ce51ce8
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index c2095ab..b2fd31d 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -54,13 +54,11 @@ static int acpi_processor_apply_limit(st
u16 px = 0;
u16 tx = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_apply_limit");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (!pr->flags.limit)
- return_VALUE(-ENODEV);
+ return -ENODEV;
if (pr->flags.throttling) {
if (pr->limit.user.tx > tx)
@@ -84,7 +82,7 @@ static int acpi_processor_apply_limit(st
if (result)
ACPI_ERROR((AE_INFO, "Unable to set limit"));
- return_VALUE(result);
+ return result;
}
#ifdef CONFIG_CPU_FREQ
@@ -200,19 +198,17 @@ int acpi_processor_set_thermal_limit(acp
struct acpi_device *device = NULL;
int tx = 0, max_tx_px = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit");
-
if ((type < ACPI_PROCESSOR_LIMIT_NONE)
|| (type > ACPI_PROCESSOR_LIMIT_DECREMENT))
- return_VALUE(-EINVAL);
+ return -EINVAL;
result = acpi_bus_get_device(handle, &device);
if (result)
- return_VALUE(result);
+ return result;
pr = (struct acpi_processor *)acpi_driver_data(device);
if (!pr)
- return_VALUE(-ENODEV);
+ return -ENODEV;
/* Thermal limits are always relative to the current Px/Tx state. */
if (pr->flags.throttling)
@@ -296,22 +292,20 @@ int acpi_processor_set_thermal_limit(acp
} else
result = 0;
if (max_tx_px)
- return_VALUE(1);
+ return 1;
else
- return_VALUE(result);
+ return result;
}
int acpi_processor_get_limit_info(struct acpi_processor *pr)
{
- ACPI_FUNCTION_TRACE("acpi_processor_get_limit_info");
-
if (!pr)
- return_VALUE(-EINVAL);
+ return -EINVAL;
if (pr->flags.throttling)
pr->flags.limit = 1;
- return_VALUE(0);
+ return 0;
}
/* /proc interface */
@@ -320,8 +314,6 @@ static int acpi_processor_limit_seq_show
{
struct acpi_processor *pr = (struct acpi_processor *)seq->private;
- ACPI_FUNCTION_TRACE("acpi_processor_limit_seq_show");
-
if (!pr)
goto end;
@@ -338,7 +330,7 @@ static int acpi_processor_limit_seq_show
pr->limit.thermal.px, pr->limit.thermal.tx);
end:
- return_VALUE(0);
+ return 0;
}
static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
@@ -358,34 +350,32 @@ static ssize_t acpi_processor_write_limi
int px = 0;
int tx = 0;
- ACPI_FUNCTION_TRACE("acpi_processor_write_limit");
-
if (!pr || (count > sizeof(limit_string) - 1)) {
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
if (copy_from_user(limit_string, buffer, count)) {
- return_VALUE(-EFAULT);
+ return -EFAULT;
}
limit_string[count] = '\0';
if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) {
ACPI_ERROR((AE_INFO, "Invalid data format"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
if (pr->flags.throttling) {
if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {
ACPI_ERROR((AE_INFO, "Invalid tx"));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
pr->limit.user.tx = tx;
}
result = acpi_processor_apply_limit(pr);
- return_VALUE(count);
+ return count;
}
struct file_operations acpi_processor_limit_fops = {
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 24+ messages in thread
end of thread, other threads:[~2006-04-18 1:25 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 20/24] Remove unneeded debugging macros in drivers/acpi/processor_perflib.c mochel
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
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.