Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93851b4d authored by Lin Ming's avatar Lin Ming Committed by Len Brown
Browse files

ACPICA: Reduce error to warning for incorrect method arg count

Previously aborted with error if too few arguments were passed to
a control method via the external ACPICA interface. Now issue a
warning instead and continue. Handles the case where the method
inadvertently declares too many arguments, but does not actually
use the extra ones.  Applies mainly to the predefined methods.

http://bugzilla.kernel.org/show_bug.cgi?id=11032



Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent b68bacf2
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -148,21 +148,22 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
				info->param_count++;
		}

		/* Error if too few arguments were passed in */
		/*
		 * Warning if too few or too many arguments have been passed by the
		 * caller. We don't want to abort here with an error because an
		 * incorrect number of arguments may not cause the method to fail.
		 * However, the method will fail if there are too few arguments passed
		 * and the method attempts to use one of the missing ones.
		 */

		if (info->param_count < info->obj_desc->method.param_count) {
			ACPI_ERROR((AE_INFO,
			ACPI_WARNING((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 >
		} else if (info->param_count >
				info->obj_desc->method.param_count) {
			ACPI_WARNING((AE_INFO,
				      "Excess arguments - "