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

Commit dc95a270 authored by Bob Moore's avatar Bob Moore Committed by Len Brown
Browse files

ACPICA: Deploy new create integer interface where appropriate

Simplifies creation of simple integer objects.
ACPICA BZ 823.

http://www.acpica.org/bugzilla/show_bug.cgi?id=823



Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 502f7efa
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -409,13 +409,11 @@ acpi_ds_method_data_get_value(u8 type,
		/* If slack enabled, init the local_x/arg_x to an Integer of value zero */

		if (acpi_gbl_enable_interpreter_slack) {
			object =
			    acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
			object = acpi_ut_create_integer_object((u64) 0);
			if (!object) {
				return_ACPI_STATUS(AE_NO_MEMORY);
			}

			object->integer.value = 0;
			node->object = object;
		}

+4 −7
Original line number Diff line number Diff line
@@ -289,23 +289,20 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
	 *  connection status 1 for connecting the handler, 0 for disconnecting
	 *  the handler (Passed as a parameter)
	 */
	args[0] = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
	args[0] =
	    acpi_ut_create_integer_object((u64) region_obj->region.space_id);
	if (!args[0]) {
		status = AE_NO_MEMORY;
		goto cleanup1;
	}

	args[1] = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
	args[1] = acpi_ut_create_integer_object((u64) function);
	if (!args[1]) {
		status = AE_NO_MEMORY;
		goto cleanup2;
	}

	/* Setup the parameter objects */

	args[0]->integer.value = region_obj->region.space_id;
	args[1]->integer.value = function;
	args[2] = NULL;
	args[2] = NULL;		/* Terminate list */

	/* Execute the method, no return value */

+1 −3
Original line number Diff line number Diff line
@@ -170,14 +170,12 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,

		/* Table not found, return an Integer=0 and AE_OK */

		ddb_handle = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
		ddb_handle = acpi_ut_create_integer_object((u64) 0);
		if (!ddb_handle) {
			return_ACPI_STATUS(AE_NO_MEMORY);
		}

		ddb_handle->integer.value = 0;
		*return_desc = ddb_handle;

		return_ACPI_STATUS(AE_OK);
	}

+1 −2
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,

	/* Create a new integer */

	return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
	return_desc = acpi_ut_create_integer_object(result);
	if (!return_desc) {
		return_ACPI_STATUS(AE_NO_MEMORY);
	}
@@ -177,7 +177,6 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,

	/* Save the Result */

	return_desc->integer.value = result;
	acpi_ex_truncate_for32bit_table(return_desc);
	*result_desc = return_desc;
	return_ACPI_STATUS(AE_OK);
+1 −2
Original line number Diff line number Diff line
@@ -162,13 +162,12 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
	} else {
		/* Field will fit within an Integer (normal case) */

		buffer_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
		buffer_desc = acpi_ut_create_integer_object((u64) 0);
		if (!buffer_desc) {
			return_ACPI_STATUS(AE_NO_MEMORY);
		}

		length = acpi_gbl_integer_byte_width;
		buffer_desc->integer.value = 0;
		buffer = &buffer_desc->integer.value;
	}

Loading