diff options
author | Bob Moore <robert.moore@intel.com> | 2010-10-17 20:47:16 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-10-17 22:55:39 -0400 |
commit | 34cf66e724a2bf0a406d59b18f5bfeed746d7979 (patch) | |
tree | aed0aa36e8d33c898f84124ad1ecf2acfc3e745a /drivers/acpi/acpica | |
parent | 81256669aaaa8b06a617f8d0613cb7fb24f8b910 (diff) |
ACPICA: Eliminate duplicate code in acpi_ut_execute_* functions
Now that the nsrepair code automatically repairs _HID-related
strings, this type of code is no longer needed in acpi_ut_execute_HID,
acpi_ut_execute_CID, and acpi_ut_execute_UID. ACPICA BZ 878.
http://www.acpica.org/bugzilla/show_bug.cgi?id=878
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/utids.c | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c index 1397fadd0d4b..d2906328535d 100644 --- a/drivers/acpi/acpica/utids.c +++ b/drivers/acpi/acpica/utids.c | |||
@@ -48,42 +48,6 @@ | |||
48 | #define _COMPONENT ACPI_UTILITIES | 48 | #define _COMPONENT ACPI_UTILITIES |
49 | ACPI_MODULE_NAME("utids") | 49 | ACPI_MODULE_NAME("utids") |
50 | 50 | ||
51 | /* Local prototypes */ | ||
52 | static void acpi_ut_copy_id_string(char *destination, char *source); | ||
53 | |||
54 | /******************************************************************************* | ||
55 | * | ||
56 | * FUNCTION: acpi_ut_copy_id_string | ||
57 | * | ||
58 | * PARAMETERS: Destination - Where to copy the string | ||
59 | * Source - Source string | ||
60 | * | ||
61 | * RETURN: None | ||
62 | * | ||
63 | * DESCRIPTION: Copies an ID string for the _HID, _CID, and _UID methods. | ||
64 | * Performs removal of a leading asterisk if present -- workaround | ||
65 | * for a known issue on a bunch of machines. | ||
66 | * | ||
67 | ******************************************************************************/ | ||
68 | |||
69 | static void acpi_ut_copy_id_string(char *destination, char *source) | ||
70 | { | ||
71 | |||
72 | /* | ||
73 | * Workaround for ID strings that have a leading asterisk. This construct | ||
74 | * is not allowed by the ACPI specification (ID strings must be | ||
75 | * alphanumeric), but enough existing machines have this embedded in their | ||
76 | * ID strings that the following code is useful. | ||
77 | */ | ||
78 | if (*source == '*') { | ||
79 | source++; | ||
80 | } | ||
81 | |||
82 | /* Do the actual copy */ | ||
83 | |||
84 | ACPI_STRCPY(destination, source); | ||
85 | } | ||
86 | |||
87 | /******************************************************************************* | 51 | /******************************************************************************* |
88 | * | 52 | * |
89 | * FUNCTION: acpi_ut_execute_HID | 53 | * FUNCTION: acpi_ut_execute_HID |
@@ -101,7 +65,6 @@ static void acpi_ut_copy_id_string(char *destination, char *source) | |||
101 | * NOTE: Internal function, no parameter validation | 65 | * NOTE: Internal function, no parameter validation |
102 | * | 66 | * |
103 | ******************************************************************************/ | 67 | ******************************************************************************/ |
104 | |||
105 | acpi_status | 68 | acpi_status |
106 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, | 69 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, |
107 | struct acpica_device_id **return_id) | 70 | struct acpica_device_id **return_id) |
@@ -147,7 +110,7 @@ acpi_ut_execute_HID(struct acpi_namespace_node *device_node, | |||
147 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { | 110 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { |
148 | acpi_ex_eisa_id_to_string(hid->string, obj_desc->integer.value); | 111 | acpi_ex_eisa_id_to_string(hid->string, obj_desc->integer.value); |
149 | } else { | 112 | } else { |
150 | acpi_ut_copy_id_string(hid->string, obj_desc->string.pointer); | 113 | ACPI_STRCPY(hid->string, obj_desc->string.pointer); |
151 | } | 114 | } |
152 | 115 | ||
153 | hid->length = length; | 116 | hid->length = length; |
@@ -224,7 +187,7 @@ acpi_ut_execute_UID(struct acpi_namespace_node *device_node, | |||
224 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { | 187 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { |
225 | acpi_ex_integer_to_string(uid->string, obj_desc->integer.value); | 188 | acpi_ex_integer_to_string(uid->string, obj_desc->integer.value); |
226 | } else { | 189 | } else { |
227 | acpi_ut_copy_id_string(uid->string, obj_desc->string.pointer); | 190 | ACPI_STRCPY(uid->string, obj_desc->string.pointer); |
228 | } | 191 | } |
229 | 192 | ||
230 | uid->length = length; | 193 | uid->length = length; |
@@ -357,8 +320,8 @@ acpi_ut_execute_CID(struct acpi_namespace_node *device_node, | |||
357 | 320 | ||
358 | /* Copy the String CID from the returned object */ | 321 | /* Copy the String CID from the returned object */ |
359 | 322 | ||
360 | acpi_ut_copy_id_string(next_id_string, | 323 | ACPI_STRCPY(next_id_string, |
361 | cid_objects[i]->string.pointer); | 324 | cid_objects[i]->string.pointer); |
362 | length = cid_objects[i]->string.length + 1; | 325 | length = cid_objects[i]->string.length + 1; |
363 | } | 326 | } |
364 | 327 | ||