summaryrefslogtreecommitdiff
path: root/drivers/acpi/namespace/nseval.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-18 02:39:39 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-18 02:39:39 -0700
commit49997d75152b3d23c53b0fa730599f2f74c92c65 (patch)
tree46e93126170d02cfec9505172e545732c1b69656 /drivers/acpi/namespace/nseval.c
parenta0c80b80e0fb48129e4e9d6a9ede914f9ff1850d (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: Documentation/powerpc/booting-without-of.txt drivers/atm/Makefile drivers/net/fs_enet/fs_enet-main.c drivers/pci/pci-acpi.c net/8021q/vlan.c net/iucv/iucv.c
Diffstat (limited to 'drivers/acpi/namespace/nseval.c')
-rw-r--r--drivers/acpi/namespace/nseval.c35
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)
return_ACPI_STATUS(AE_NULL_OBJECT);
}
+ /*
+ * Calculate the number of arguments being passed to the method
+ */
+
+ info->param_count = 0;
+ if (info->parameters) {
+ while (info->parameters[info->param_count])
+ info->param_count++;
+ }
+
+ /* Error if too few arguments were passed in */
+
+ if (info->param_count < info->obj_desc->method.param_count) {
+ ACPI_ERROR((AE_INFO,
+ "Insufficient arguments - "
+ "method [%4.4s] needs %d, found %d",
+ acpi_ut_get_node_name(info->resolved_node),
+ info->obj_desc->method.param_count,
+ info->param_count));
+ return_ACPI_STATUS(AE_MISSING_ARGUMENTS);
+ }
+
+ /* Just a warning if too many arguments */
+
+ else if (info->param_count >
+ info->obj_desc->method.param_count) {
+ ACPI_WARNING((AE_INFO,
+ "Excess arguments - "
+ "method [%4.4s] needs %d, found %d",
+ acpi_ut_get_node_name(info->
+ resolved_node),
+ info->obj_desc->method.param_count,
+ info->param_count));
+ }
+
ACPI_DUMP_PATHNAME(info->resolved_node, "Execute Method:",
ACPI_LV_INFO, _COMPONENT);