diff options
Diffstat (limited to 'drivers/acpi/resources/rscalc.c')
-rw-r--r-- | drivers/acpi/resources/rscalc.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c index 0dd2ce8a3475..8a112d11d491 100644 --- a/drivers/acpi/resources/rscalc.c +++ b/drivers/acpi/resources/rscalc.c | |||
@@ -5,7 +5,7 @@ | |||
5 | ******************************************************************************/ | 5 | ******************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -73,7 +73,7 @@ acpi_rs_stream_option_length(u32 resource_length, u32 minimum_total_length); | |||
73 | 73 | ||
74 | static u8 acpi_rs_count_set_bits(u16 bit_field) | 74 | static u8 acpi_rs_count_set_bits(u16 bit_field) |
75 | { | 75 | { |
76 | u8 bits_set; | 76 | acpi_native_uint bits_set; |
77 | 77 | ||
78 | ACPI_FUNCTION_ENTRY(); | 78 | ACPI_FUNCTION_ENTRY(); |
79 | 79 | ||
@@ -81,10 +81,10 @@ static u8 acpi_rs_count_set_bits(u16 bit_field) | |||
81 | 81 | ||
82 | /* Zero the least significant bit that is set */ | 82 | /* Zero the least significant bit that is set */ |
83 | 83 | ||
84 | bit_field &= (bit_field - 1); | 84 | bit_field &= (u16) (bit_field - 1); |
85 | } | 85 | } |
86 | 86 | ||
87 | return (bits_set); | 87 | return ((u8) bits_set); |
88 | } | 88 | } |
89 | 89 | ||
90 | /******************************************************************************* | 90 | /******************************************************************************* |
@@ -211,6 +211,24 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) | |||
211 | * variable-length fields | 211 | * variable-length fields |
212 | */ | 212 | */ |
213 | switch (resource->type) { | 213 | switch (resource->type) { |
214 | case ACPI_RESOURCE_TYPE_IRQ: | ||
215 | |||
216 | /* Length can be 3 or 2 */ | ||
217 | |||
218 | if (resource->data.irq.descriptor_length == 2) { | ||
219 | total_size--; | ||
220 | } | ||
221 | break; | ||
222 | |||
223 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: | ||
224 | |||
225 | /* Length can be 1 or 0 */ | ||
226 | |||
227 | if (resource->data.irq.descriptor_length == 0) { | ||
228 | total_size--; | ||
229 | } | ||
230 | break; | ||
231 | |||
214 | case ACPI_RESOURCE_TYPE_VENDOR: | 232 | case ACPI_RESOURCE_TYPE_VENDOR: |
215 | /* | 233 | /* |
216 | * Vendor Defined Resource: | 234 | * Vendor Defined Resource: |