return_desc = acpi_ut_create_buffer_object ( 
return_desc = acpi_ut_create_buffer_object ((acpi_size) 
acpi_ex_do_concatenate (	union acpi_operand_object       *operand0,	union acpi_operand_object       *operand1,	union acpi_operand_object       **actual_return_desc,	struct acpi_walk_state          *walk_state){	union acpi_operand_object       *local_operand1 = operand1;	union acpi_operand_object       *return_desc;	char                            *new_buf;	acpi_status                     status;	acpi_size                       new_length;	ACPI_FUNCTION_TRACE ("ex_do_concatenate");	/*	 * Convert the second operand if necessary.  The first operand	 * determines the type of the second operand, (See the Data Types	 * section of the ACPI specification.)  Both object types are	 * guaranteed to be either Integer/String/Buffer by the operand	 * resolution mechanism.	 */	switch (ACPI_GET_OBJECT_TYPE (operand0)) {	case ACPI_TYPE_INTEGER:		status = acpi_ex_convert_to_integer (operand1, &local_operand1, 16);		break;	case ACPI_TYPE_STRING:		status = acpi_ex_convert_to_string (operand1, &local_operand1,				 ACPI_IMPLICIT_CONVERT_HEX);		break;	case ACPI_TYPE_BUFFER:		status = acpi_ex_convert_to_buffer (operand1, &local_operand1);		break;	default:		ACPI_REPORT_ERROR (("Concat - invalid obj type: %X\n",				ACPI_GET_OBJECT_TYPE (operand0)));		status = AE_AML_INTERNAL;	}	if (ACPI_FAILURE (status)) {		goto cleanup;	}	/*	 * Both operands are now known to be the same object type	 * (Both are Integer, String, or Buffer), and we can now perform the	 * concatenation.	 */	/*	 * There are three cases to handle:	 *	 * 1) Two Integers concatenated to produce a new Buffer	 * 2) Two Strings concatenated to produce a new String	 * 3) Two Buffers concatenated to produce a new Buffer	 */	switch (ACPI_GET_OBJECT_TYPE (operand0)) {	case ACPI_TYPE_INTEGER:		/* Result of two Integers is a Buffer */		/* Need enough buffer space for two integers */		return_desc = acpi_ut_create_buffer_object (				   ACPI_MUL_2 (acpi_gbl_integer_byte_width));		if (!return_desc) {			status = AE_NO_MEMORY;			goto cleanup;		}		new_buf = (char *) return_desc->buffer.pointer;		/* Copy the first integer, LSB first */		ACPI_MEMCPY (new_buf,				  &operand0->integer.value,				  acpi_gbl_integer_byte_width);		/* Copy the second integer (LSB first) after the first */		ACPI_MEMCPY (new_buf + acpi_gbl_integer_byte_width,				  &local_operand1->integer.value,				  acpi_gbl_integer_byte_width);		break;	case ACPI_TYPE_STRING:		/* Result of two Strings is a String */		new_length = (acpi_size) operand0->string.length +				 (acpi_size) local_operand1->string.length;		if (new_length > ACPI_MAX_STRING_CONVERSION) {			status = AE_AML_STRING_LIMIT;			goto cleanup;		}		return_desc = acpi_ut_create_string_object (new_length);		if (!return_desc) {			status = AE_NO_MEMORY;			goto cleanup;		}		new_buf = return_desc->string.pointer;		/* Concatenate the strings */		ACPI_STRCPY (new_buf,				  operand0->string.pointer);		ACPI_STRCPY (new_buf + operand0->string.length,				  local_operand1->string.pointer);		break;	case ACPI_TYPE_BUFFER:		/* Result of two Buffers is a Buffer */		return_desc = acpi_ut_create_buffer_object (				   (acpi_size) operand0->buffer.length +				   (acpi_size) local_operand1->buffer.length);		if (!return_desc) {			status = AE_NO_MEMORY;			goto cleanup;		}		new_buf = (char *) return_desc->buffer.pointer;		/* Concatenate the buffers */		ACPI_MEMCPY (new_buf,				  operand0->buffer.pointer,				  operand0->buffer.length);		ACPI_MEMCPY (new_buf + operand0->buffer.length,				  local_operand1->buffer.pointer,				  local_operand1->buffer.length);		break;	default:		/* Invalid object type, should not happen here */		ACPI_REPORT_ERROR (("Concatenate - Invalid object type: %X\n",				ACPI_GET_OBJECT_TYPE (operand0)));		status =AE_AML_INTERNAL;		goto cleanup;	}	*actual_return_desc = return_desc;cleanup:	if (local_operand1 != operand1) {		acpi_ut_remove_reference (local_operand1);	}	return_ACPI_STATUS (status);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/73459f73e5d1602c59ebec114fc45185521353c1/exmisc.c/buggy/drivers/acpi/executer/exmisc.c