linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / acpi / processor_throttling.c
index d044ec5..b966549 100644 (file)
@@ -55,12 +55,13 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
        u32 duty_mask = 0;
        u32 duty_value = 0;
 
+       ACPI_FUNCTION_TRACE("acpi_processor_get_throttling");
 
        if (!pr)
-               return -EINVAL;
+               return_VALUE(-EINVAL);
 
        if (!pr->flags.throttling)
-               return -ENODEV;
+               return_VALUE(-ENODEV);
 
        pr->throttling.state = 0;
 
@@ -92,7 +93,7 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
                          "Throttling state is T%d (%d%% throttling applied)\n",
                          state, pr->throttling.states[state].performance));
 
-       return 0;
+       return_VALUE(0);
 }
 
 int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
@@ -101,18 +102,19 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
        u32 duty_mask = 0;
        u32 duty_value = 0;
 
+       ACPI_FUNCTION_TRACE("acpi_processor_set_throttling");
 
        if (!pr)
-               return -EINVAL;
+               return_VALUE(-EINVAL);
 
        if ((state < 0) || (state > (pr->throttling.state_count - 1)))
-               return -EINVAL;
+               return_VALUE(-EINVAL);
 
        if (!pr->flags.throttling)
-               return -ENODEV;
+               return_VALUE(-ENODEV);
 
        if (state == pr->throttling.state)
-               return 0;
+               return_VALUE(0);
 
        /*
         * Calculate the duty_value and duty_mask.
@@ -163,7 +165,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
                          (pr->throttling.states[state].performance ? pr->
                           throttling.states[state].performance / 10 : 0)));
 
-       return 0;
+       return_VALUE(0);
 }
 
 int acpi_processor_get_throttling_info(struct acpi_processor *pr)
@@ -172,6 +174,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        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",
@@ -180,21 +183,21 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
                          pr->throttling.duty_width));
 
        if (!pr)
-               return -EINVAL;
+               return_VALUE(-EINVAL);
 
        /* TBD: Support ACPI 2.0 objects */
 
        if (!pr->throttling.address) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
-               return 0;
+               return_VALUE(0);
        } else if (!pr->throttling.duty_width) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));
-               return 0;
+               return_VALUE(0);
        }
        /* TBD: Support duty_cycle values that span bit 4. */
        else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {
-               printk(KERN_WARNING PREFIX "duty_cycle spans bit 4\n");
-               return 0;
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "duty_cycle spans bit 4\n"));
+               return_VALUE(0);
        }
 
        /*
@@ -205,7 +208,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        if (errata.piix4.throttle) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Throttling not supported on PIIX4 A- or B-step\n"));
-               return 0;
+               return_VALUE(0);
        }
 
        pr->throttling.state_count = 1 << acpi_fadt.duty_width;
@@ -251,7 +254,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        if (result)
                pr->flags.throttling = 0;
 
-       return result;
+       return_VALUE(result);
 }
 
 /* proc interface */
@@ -263,6 +266,7 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
        int i = 0;
        int result = 0;
 
+       ACPI_FUNCTION_TRACE("acpi_processor_throttling_seq_show");
 
        if (!pr)
                goto end;
@@ -292,7 +296,7 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
                            throttling.states[i].performance / 10 : 0));
 
       end:
-       return 0;
+       return_VALUE(0);
 }
 
 static int acpi_processor_throttling_open_fs(struct inode *inode,
@@ -311,12 +315,13 @@ static ssize_t acpi_processor_write_throttling(struct file * file,
        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 -EINVAL;
+               return_VALUE(-EINVAL);
 
        if (copy_from_user(state_string, buffer, count))
-               return -EFAULT;
+               return_VALUE(-EFAULT);
 
        state_string[count] = '\0';
 
@@ -324,9 +329,9 @@ static ssize_t acpi_processor_write_throttling(struct file * file,
                                               simple_strtoul(state_string,
                                                              NULL, 0));
        if (result)
-               return result;
+               return_VALUE(result);
 
-       return count;
+       return_VALUE(count);
 }
 
 struct file_operations acpi_processor_throttling_fops = {