diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/namespace/nseval.c | 35 |
1 files changed, 35 insertions, 0 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 | ||