aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utresrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utresrc.c')
-rw-r--r--drivers/acpi/utilities/utresrc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/acpi/utilities/utresrc.c b/drivers/acpi/utilities/utresrc.c
index 07a314c710d8..6c0ce7b12194 100644
--- a/drivers/acpi/utilities/utresrc.c
+++ b/drivers/acpi/utilities/utresrc.c
@@ -157,7 +157,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
157 /* 157 /*
158 * 1) Validate the resource_type field (Byte 0) 158 * 1) Validate the resource_type field (Byte 0)
159 */ 159 */
160 resource_type = *((u8 *) aml); 160 resource_type = ACPI_GET8(aml);
161 161
162 /* 162 /*
163 * Byte 0 contains the descriptor name (Resource Type) 163 * Byte 0 contains the descriptor name (Resource Type)
@@ -266,14 +266,14 @@ u8 acpi_ut_get_resource_type(void *aml)
266 * Byte 0 contains the descriptor name (Resource Type) 266 * Byte 0 contains the descriptor name (Resource Type)
267 * Examine the large/small bit in the resource header 267 * Examine the large/small bit in the resource header
268 */ 268 */
269 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) { 269 if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
270 /* Large Resource Type -- bits 6:0 contain the name */ 270 /* Large Resource Type -- bits 6:0 contain the name */
271 271
272 return (*((u8 *) aml)); 272 return (ACPI_GET8(aml));
273 } else { 273 } else {
274 /* Small Resource Type -- bits 6:3 contain the name */ 274 /* Small Resource Type -- bits 6:3 contain the name */
275 275
276 return ((u8) (*((u8 *) aml) & ACPI_RESOURCE_NAME_SMALL_MASK)); 276 return ((u8) (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_SMALL_MASK));
277 } 277 }
278} 278}
279 279
@@ -301,15 +301,15 @@ u16 acpi_ut_get_resource_length(void *aml)
301 * Byte 0 contains the descriptor name (Resource Type) 301 * Byte 0 contains the descriptor name (Resource Type)
302 * Examine the large/small bit in the resource header 302 * Examine the large/small bit in the resource header
303 */ 303 */
304 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) { 304 if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
305 /* Large Resource type -- bytes 1-2 contain the 16-bit length */ 305 /* Large Resource type -- bytes 1-2 contain the 16-bit length */
306 306
307 ACPI_MOVE_16_TO_16(&resource_length, &((u8 *) aml)[1]); 307 ACPI_MOVE_16_TO_16(&resource_length, ACPI_ADD_PTR(u8, aml, 1));
308 308
309 } else { 309 } else {
310 /* Small Resource type -- bits 2:0 of byte 0 contain the length */ 310 /* Small Resource type -- bits 2:0 of byte 0 contain the length */
311 311
312 resource_length = (u16) (*((u8 *) aml) & 312 resource_length = (u16) (ACPI_GET8(aml) &
313 ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK); 313 ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
314 } 314 }
315 315
@@ -334,7 +334,7 @@ u8 acpi_ut_get_resource_header_length(void *aml)
334 334
335 /* Examine the large/small bit in the resource header */ 335 /* Examine the large/small bit in the resource header */
336 336
337 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) { 337 if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
338 return (sizeof(struct aml_resource_large_header)); 338 return (sizeof(struct aml_resource_large_header));
339 } else { 339 } else {
340 return (sizeof(struct aml_resource_small_header)); 340 return (sizeof(struct aml_resource_small_header));
@@ -372,8 +372,9 @@ u32 acpi_ut_get_descriptor_length(void *aml)
372 * FUNCTION: acpi_ut_get_resource_end_tag 372 * FUNCTION: acpi_ut_get_resource_end_tag
373 * 373 *
374 * PARAMETERS: obj_desc - The resource template buffer object 374 * PARAMETERS: obj_desc - The resource template buffer object
375 * end_tag - Where the pointer to the end_tag is returned
375 * 376 *
376 * RETURN: Pointer to the end tag 377 * RETURN: Status, pointer to the end tag
377 * 378 *
378 * DESCRIPTION: Find the end_tag resource descriptor in an AML resource template 379 * DESCRIPTION: Find the end_tag resource descriptor in an AML resource template
379 * 380 *