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

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

ACPICA: Update for new gcc-4 warning options



Added several new options for the gcc-4 generation, and updated
the source accordingly. This includes some code restructuring to
eliminate unreachable code, elimination of some gotos, elimination
of unused return values, and some additional casting.

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 92dcffb9
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -490,7 +490,11 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,

	status = acpi_tb_add_table(&table_desc, &table_index);
	if (ACPI_FAILURE(status)) {
		goto cleanup;

		/* Delete allocated table buffer */

		acpi_tb_delete_table(&table_desc);
		return_ACPI_STATUS(status);
	}

	/*
@@ -533,13 +537,6 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
					     acpi_gbl_table_handler_context);
	}

      cleanup:
	if (ACPI_FAILURE(status)) {

		/* Delete allocated table buffer */

		acpi_tb_delete_table(&table_desc);
	}
	return_ACPI_STATUS(status);
}

+2 −4
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,

	status = acpi_hw_read(&in_byte, &gpe_register_info->status_address);
	if (ACPI_FAILURE(status)) {
		goto unlock_and_exit;
		return (status);
	}

	if (register_bit & in_byte) {
@@ -234,9 +234,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
	/* Set return value */

	(*event_status) = local_event_status;

      unlock_and_exit:
	return (status);
	return (AE_OK);
}

/******************************************************************************
+11 −13
Original line number Diff line number Diff line
@@ -1000,18 +1000,7 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data,

	/* Is the object one of the expected types? */

	if (!(return_btype & expected_btypes)) {

		/* Type mismatch -- attempt repair of the returned object */

		status = acpi_ns_repair_object(data, expected_btypes,
					       package_index,
					       return_object_ptr);
		if (ACPI_SUCCESS(status)) {
			return (AE_OK);	/* Repair was successful */
		}
		goto type_error_exit;
	}
	if (return_btype & expected_btypes) {

		/* For reference objects, check that the reference type is correct */

@@ -1020,6 +1009,15 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data,
		}

		return (status);
	}

	/* Type mismatch -- attempt repair of the returned object */

	status = acpi_ns_repair_object(data, expected_btypes,
				       package_index, return_object_ptr);
	if (ACPI_SUCCESS(status)) {
		return (AE_OK);	/* Repair was successful */
	}

      type_error_exit:

+9 −15
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ acpi_ns_check_sorted_list(struct acpi_predefined_data *data,
			  u32 sort_index,
			  u8 sort_direction, char *sort_key_name);

static acpi_status
static void
acpi_ns_sort_list(union acpi_operand_object **elements,
		  u32 count, u32 index, u8 sort_direction);

@@ -443,7 +443,6 @@ acpi_ns_check_sorted_list(struct acpi_predefined_data *data,
	union acpi_operand_object *obj_desc;
	u32 i;
	u32 previous_value;
	acpi_status status;

	ACPI_FUNCTION_NAME(ns_check_sorted_list);

@@ -494,19 +493,15 @@ acpi_ns_check_sorted_list(struct acpi_predefined_data *data,

		/*
		 * The list must be sorted in the specified order. If we detect a
		 * discrepancy, issue a warning and sort the entire list
		 * discrepancy, sort the entire list.
		 */
		if (((sort_direction == ACPI_SORT_ASCENDING) &&
		     (obj_desc->integer.value < previous_value)) ||
		    ((sort_direction == ACPI_SORT_DESCENDING) &&
		     (obj_desc->integer.value > previous_value))) {
			status =
			acpi_ns_sort_list(return_object->package.elements,
					  outer_element_count, sort_index,
					  sort_direction);
			if (ACPI_FAILURE(status)) {
				return (status);
			}

			data->flags |= ACPI_OBJECT_REPAIRED;

@@ -615,15 +610,16 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
 *              Index               - Sort by which package element
 *              sort_direction      - Ascending or Descending sort
 *
 * RETURN:      Status
 * RETURN:      None
 *
 * DESCRIPTION: Sort the objects that are in a package element list.
 *
 * NOTE: Assumes that all NULL elements have been removed from the package.
 * NOTE: Assumes that all NULL elements have been removed from the package,
 *       and that all elements have been verified to be of type Integer.
 *
 *****************************************************************************/

static acpi_status
static void
acpi_ns_sort_list(union acpi_operand_object **elements,
		  u32 count, u32 index, u8 sort_direction)
{
@@ -652,6 +648,4 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
			}
		}
	}

	return (AE_OK);
}
+3 −13
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ ACPI_MODULE_NAME("utmutex")
/* Local prototypes */
static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id);

static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id);
static void acpi_ut_delete_mutex(acpi_mutex_handle mutex_id);

/*******************************************************************************
 *
@@ -114,7 +114,7 @@ void acpi_ut_mutex_terminate(void)
	/* Delete each predefined mutex object */

	for (i = 0; i < ACPI_NUM_MUTEX; i++) {
		(void)acpi_ut_delete_mutex(i);
		acpi_ut_delete_mutex(i);
	}

	/* Delete the spinlocks */
@@ -146,10 +146,6 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)

	ACPI_FUNCTION_TRACE_U32(ut_create_mutex, mutex_id);

	if (mutex_id > ACPI_MAX_MUTEX) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	if (!acpi_gbl_mutex_info[mutex_id].mutex) {
		status =
		    acpi_os_create_mutex(&acpi_gbl_mutex_info[mutex_id].mutex);
@@ -173,21 +169,15 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)
 *
 ******************************************************************************/

static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
static void acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
{

	ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id);

	if (mutex_id > ACPI_MAX_MUTEX) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	acpi_os_delete_mutex(acpi_gbl_mutex_info[mutex_id].mutex);

	acpi_gbl_mutex_info[mutex_id].mutex = NULL;
	acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;

	return_ACPI_STATUS(AE_OK);
}

/*******************************************************************************
Loading