diff options
-rw-r--r-- | drivers/acpi/namespace/nseval.c | 35 | ||||
-rw-r--r-- | include/acpi/acexcep.h | 6 | ||||
-rw-r--r-- | include/acpi/acstruct.h | 1 |
3 files changed, 40 insertions, 2 deletions
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c index 14bdfa92bea0..d369164e00b0 100644 --- a/drivers/acpi/namespace/nseval.c +++ b/drivers/acpi/namespace/nseval.c | |||
@@ -138,6 +138,41 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) | |||
138 | return_ACPI_STATUS(AE_NULL_OBJECT); | 138 | return_ACPI_STATUS(AE_NULL_OBJECT); |
139 | } | 139 | } |
140 | 140 | ||
141 | /* | ||
142 | * Calculate the number of arguments being passed to the method | ||
143 | */ | ||
144 | |||
145 | info->param_count = 0; | ||
146 | if (info->parameters) { | ||
147 | while (info->parameters[info->param_count]) | ||
148 | info->param_count++; | ||
149 | } | ||
150 | |||
151 | /* Error if too few arguments were passed in */ | ||
152 | |||
153 | if (info->param_count < info->obj_desc->method.param_count) { | ||
154 | ACPI_ERROR((AE_INFO, | ||
155 | "Insufficient arguments - " | ||
156 | "method [%4.4s] needs %d, found %d", | ||
157 | acpi_ut_get_node_name(info->resolved_node), | ||
158 | info->obj_desc->method.param_count, | ||
159 | info->param_count)); | ||
160 | return_ACPI_STATUS(AE_MISSING_ARGUMENTS); | ||
161 | } | ||
162 | |||
163 | /* Just a warning if too many arguments */ | ||
164 | |||
165 | else if (info->param_count > | ||
166 | info->obj_desc->method.param_count) { | ||
167 | ACPI_WARNING((AE_INFO, | ||
168 | "Excess arguments - " | ||
169 | "method [%4.4s] needs %d, found %d", | ||
170 | acpi_ut_get_node_name(info-> | ||
171 | resolved_node), | ||
172 | info->obj_desc->method.param_count, | ||
173 | info->param_count)); | ||
174 | } | ||
175 | |||
141 | ACPI_DUMP_PATHNAME(info->resolved_node, "Execute Method:", | 176 | ACPI_DUMP_PATHNAME(info->resolved_node, "Execute Method:", |
142 | ACPI_LV_INFO, _COMPONENT); | 177 | ACPI_LV_INFO, _COMPONENT); |
143 | 178 | ||
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 1f591171bf31..ea627ed2420d 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -108,8 +108,9 @@ | |||
108 | #define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) | 108 | #define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) |
109 | #define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) | 109 | #define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) |
110 | #define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER) | 110 | #define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER) |
111 | #define AE_MISSING_ARGUMENTS (acpi_status) (0x000A | AE_CODE_PROGRAMMER) | ||
111 | 112 | ||
112 | #define AE_CODE_PGM_MAX 0x0009 | 113 | #define AE_CODE_PGM_MAX 0x000A |
113 | 114 | ||
114 | /* | 115 | /* |
115 | * Acpi table exceptions | 116 | * Acpi table exceptions |
@@ -233,7 +234,8 @@ char const *acpi_gbl_exception_names_pgm[] = { | |||
233 | "AE_ALIGNMENT", | 234 | "AE_ALIGNMENT", |
234 | "AE_BAD_HEX_CONSTANT", | 235 | "AE_BAD_HEX_CONSTANT", |
235 | "AE_BAD_OCTAL_CONSTANT", | 236 | "AE_BAD_OCTAL_CONSTANT", |
236 | "AE_BAD_DECIMAL_CONSTANT" | 237 | "AE_BAD_DECIMAL_CONSTANT", |
238 | "AE_MISSING_ARGUMENTS" | ||
237 | }; | 239 | }; |
238 | 240 | ||
239 | char const *acpi_gbl_exception_names_tbl[] = { | 241 | char const *acpi_gbl_exception_names_tbl[] = { |
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index a907c67d651e..1cc74504f1c4 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h | |||
@@ -189,6 +189,7 @@ struct acpi_evaluate_info { | |||
189 | union acpi_operand_object **parameters; | 189 | union acpi_operand_object **parameters; |
190 | struct acpi_namespace_node *resolved_node; | 190 | struct acpi_namespace_node *resolved_node; |
191 | union acpi_operand_object *return_object; | 191 | union acpi_operand_object *return_object; |
192 | u8 param_count; | ||
192 | u8 pass_number; | 193 | u8 pass_number; |
193 | u8 parameter_type; | 194 | u8 parameter_type; |
194 | u8 return_object_type; | 195 | u8 return_object_type; |