diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index d7aa9c1..1badce2 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -107,17 +107,16 @@
 	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) {
 				printk(KERN_WARNING PREFIX "Blank IRQ resource\n");
-				return_ACPI_STATUS(AE_OK);
+				return AE_OK;
 			}
 			for (i = 0;
 			     (i < p->interrupt_count
@@ -142,7 +141,7 @@
 			if (!p || !p->interrupt_count) {
 				printk(KERN_WARNING PREFIX
 					      "Blank EXT IRQ resource\n");
-				return_ACPI_STATUS(AE_OK);
+				return AE_OK;
 			}
 			for (i = 0;
 			     (i < p->interrupt_count
@@ -162,33 +161,32 @@
 		}
 	default:
 		printk(KERN_ERR PREFIX "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
@@ -196,7 +194,6 @@
 {
 	int *irq = (int *)context;
 
-	ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");
 
 	switch (resource->type) {
 	case ACPI_RESOURCE_TYPE_IRQ:
@@ -209,7 +206,7 @@
 				 */
 				ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 						  "Blank IRQ resource\n"));
-				return_ACPI_STATUS(AE_OK);
+				return AE_OK;
 			}
 			*irq = p->interrupts[0];
 			break;
@@ -225,7 +222,7 @@
 				 */
 				printk(KERN_WARNING PREFIX
 					      "Blank EXT IRQ resource\n");
-				return_ACPI_STATUS(AE_OK);
+				return AE_OK;
 			}
 			*irq = p->interrupts[0];
 			break;
@@ -234,9 +231,9 @@
 	default:
 		printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", 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;
 }
 
 /*
@@ -252,10 +249,9 @@
 	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;
 
@@ -270,7 +266,7 @@
 
 		if (!link->device->status.enabled) {
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n"));
-			return_VALUE(0);
+			return 0;
 		}
 	}
 
@@ -296,7 +292,7 @@
 	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)
@@ -309,14 +305,13 @@
 	} *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;
@@ -413,7 +408,7 @@
 
       end:
 	kfree(resource);
-	return_VALUE(result);
+	return result;
 }
 
 /* --------------------------------------------------------------------------
@@ -487,7 +482,6 @@
 	struct acpi_pci_link *link = NULL;
 	int i = 0;
 
-	ACPI_FUNCTION_TRACE("acpi_irq_penalty_init");
 
 	/*
 	 * Update penalties to facilitate IRQ balancing.
@@ -524,7 +518,7 @@
 	/* 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 */
@@ -534,13 +528,12 @@
 	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;
 	}
 
 	/*
@@ -587,7 +580,7 @@
 			    "Try pci=noacpi or acpi=off\n",
 			    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",
@@ -597,7 +590,7 @@
 
 	link->irq.initialized = 1;
 
-	return_VALUE(0);
+	return 0;
 }
 
 /*
@@ -615,36 +608,35 @@
 	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) {
 		printk(KERN_ERR PREFIX "Invalid link device\n");
-		return_VALUE(-1);
+		return -1;
 	}
 
 	link = (struct acpi_pci_link *)acpi_driver_data(device);
 	if (!link) {
 		printk(KERN_ERR PREFIX "Invalid link context\n");
-		return_VALUE(-1);
+		return -1;
 	}
 
 	/* TBD: Support multiple index (IRQ) entries per Link Device */
 	if (index) {
 		printk(KERN_ERR PREFIX "Invalid index %d\n", index);
-		return_VALUE(-1);
+		return -1;
 	}
 
 	mutex_lock(&acpi_link_lock);
 	if (acpi_pci_link_allocate(link)) {
 		mutex_unlock(&acpi_link_lock);
-		return_VALUE(-1);
+		return -1;
 	}
 
 	if (!link->irq.active) {
 		mutex_unlock(&acpi_link_lock);
 		printk(KERN_ERR PREFIX "Link active IRQ is 0!\n");
-		return_VALUE(-1);
+		return -1;
 	}
 	link->refcnt++;
 	mutex_unlock(&acpi_link_lock);
@@ -658,7 +650,7 @@
 	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);
 }
 
 /*
@@ -671,25 +663,24 @@
 	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) {
 		printk(KERN_ERR PREFIX "Invalid link device\n");
-		return_VALUE(-1);
+		return -1;
 	}
 
 	link = (struct acpi_pci_link *)acpi_driver_data(device);
 	if (!link) {
 		printk(KERN_ERR PREFIX "Invalid link context\n");
-		return_VALUE(-1);
+		return -1;
 	}
 
 	mutex_lock(&acpi_link_lock);
 	if (!link->irq.initialized) {
 		mutex_unlock(&acpi_link_lock);
 		printk(KERN_ERR PREFIX "Link isn't initialized\n");
-		return_VALUE(-1);
+		return -1;
 	}
 #ifdef	FUTURE_USE
 	/*
@@ -711,7 +702,7 @@
 		acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
 	}
 	mutex_unlock(&acpi_link_lock);
-	return_VALUE(link->irq.active);
+	return (link->irq.active);
 }
 
 /* --------------------------------------------------------------------------
@@ -725,14 +716,13 @@
 	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;
@@ -781,17 +771,16 @@
 	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;
 }
 
 /*
@@ -804,7 +793,6 @@
 	struct list_head *node = NULL;
 	struct acpi_pci_link *link = NULL;
 
-	ACPI_FUNCTION_TRACE("irqrouter_resume");
 
 	/* Make sure SCI is enabled again (Apple firmware bug?) */
 	acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK);
@@ -819,17 +807,16 @@
 		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);
 
@@ -839,7 +826,7 @@
 
 	kfree(link);
 
-	return_VALUE(0);
+	return 0;
 }
 
 /*
@@ -945,34 +932,32 @@
 {
 	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);
