Patchwork acpica + acpi: method test: remove fwts_acpica_simulate_sem_timeout()

login
register
mail settings
Submitter Colin King
Date Jan. 4, 2013, 5:12 p.m.
Message ID <1357319570-24852-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/209494/
State Accepted
Headers show

Comments

Colin King - Jan. 4, 2013, 5:12 p.m.
From: Colin Ian King <colin.king@canonical.com>

fwts_acpica_simulate_sem_timeout() was never used, it isn't helpful
and should now be removed.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/method/method.c      |  1 -
 src/acpica/fwts_acpica.c      | 14 --------------
 src/lib/include/fwts_acpica.h |  1 -
 3 files changed, 16 deletions(-)
Keng-Yu Lin - Jan. 14, 2013, 8:03 a.m.
On Sat, Jan 5, 2013 at 1:12 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> fwts_acpica_simulate_sem_timeout() was never used, it isn't helpful
> and should now be removed.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/method/method.c      |  1 -
>  src/acpica/fwts_acpica.c      | 14 --------------
>  src/lib/include/fwts_acpica.h |  1 -
>  3 files changed, 16 deletions(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 76b9f9e..f22447e 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -397,7 +397,6 @@ static int method_evaluate_method(fwts_framework *fw,
>                                 found++;
>                                 arg_list.Count   = num_args;
>                                 arg_list.Pointer = args;
> -                               fwts_acpica_simulate_sem_timeout(FWTS_FALSE);
>                                 method_evaluate_found_method(fw, method_name,
>                                         check_func, private, &arg_list);
>                         }
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index 2c489f1..26b6a13 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -95,7 +95,6 @@ static ACPI_TABLE_FADT                *fwts_acpica_FADT;
>  static void                    *fwts_acpica_DSDT;
>
>  static fwts_framework          *fwts_acpica_fw;                        /* acpica context copy of fw */
> -static int                     fwts_acpica_force_sem_timeout;          /* > 0, forces a semaphore timeout */
>  static bool                    fwts_acpica_init_called;                /* > 0, ACPICA initialised */
>  static fwts_acpica_log_callback fwts_acpica_log_callback_func = NULL;  /* logging call back func */
>
> @@ -179,16 +178,6 @@ void fwts_acpica_sem_count_get(int *acquired, int *released)
>         pthread_mutex_unlock(&mutex_lock_sem_table);
>  }
>
> -/*
> - *  fwts_acpica_simulate_sem_timeout()
> - *     force a timeout on next semaphore acuire to see if
> - *     we can break ACPI methods during testing.
> - */
> -void fwts_acpica_simulate_sem_timeout(int timeout)
> -{
> -       fwts_acpica_force_sem_timeout = timeout;
> -}
> -
>  /* ACPICA Handlers */
>
>  /*
> @@ -571,9 +560,6 @@ ACPI_STATUS AcpiOsWaitSemaphore(ACPI_HANDLE handle, UINT32 Units, UINT16 Timeout
>         if (!handle)
>                 return AE_BAD_PARAMETER;
>
> -       if (fwts_acpica_force_sem_timeout)
> -               return AE_TIME;
> -
>         switch (Timeout) {
>         case 0:
>                 if (sem_trywait(&sem->sem))
> diff --git a/src/lib/include/fwts_acpica.h b/src/lib/include/fwts_acpica.h
> index 903d168..17a5988 100644
> --- a/src/lib/include/fwts_acpica.h
> +++ b/src/lib/include/fwts_acpica.h
> @@ -31,7 +31,6 @@ void fwts_acpica_debug_command(fwts_framework *fw, fwts_acpica_log_callback func
>  fwts_list *fwts_acpica_get_object_names(int type);
>  void fwts_acpica_sem_count_clear(void);
>  void fwts_acpica_sem_count_get(int *acquired, int *released);
> -void fwts_acpica_simulate_sem_timeout(int flag);
>  void fwts_acpi_region_handler_called_set(bool val);
>  bool fwts_acpi_region_handler_called_get(void);
>
> --
> 1.8.0
>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Jan. 14, 2013, 10:07 a.m.
On 01/05/2013 01:12 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> fwts_acpica_simulate_sem_timeout() was never used, it isn't helpful
> and should now be removed.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/method/method.c      |  1 -
>   src/acpica/fwts_acpica.c      | 14 --------------
>   src/lib/include/fwts_acpica.h |  1 -
>   3 files changed, 16 deletions(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 76b9f9e..f22447e 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -397,7 +397,6 @@ static int method_evaluate_method(fwts_framework *fw,
>   				found++;
>   				arg_list.Count   = num_args;
>   				arg_list.Pointer = args;
> -				fwts_acpica_simulate_sem_timeout(FWTS_FALSE);
>   				method_evaluate_found_method(fw, method_name,
>   					check_func, private, &arg_list);
>   			}
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index 2c489f1..26b6a13 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -95,7 +95,6 @@ static ACPI_TABLE_FADT		*fwts_acpica_FADT;
>   static void 			*fwts_acpica_DSDT;
>
>   static fwts_framework		*fwts_acpica_fw;			/* acpica context copy of fw */
> -static int			fwts_acpica_force_sem_timeout;		/* > 0, forces a semaphore timeout */
>   static bool			fwts_acpica_init_called;		/* > 0, ACPICA initialised */
>   static fwts_acpica_log_callback fwts_acpica_log_callback_func = NULL;	/* logging call back func */
>
> @@ -179,16 +178,6 @@ void fwts_acpica_sem_count_get(int *acquired, int *released)
>   	pthread_mutex_unlock(&mutex_lock_sem_table);
>   }
>
> -/*
> - *  fwts_acpica_simulate_sem_timeout()
> - *	force a timeout on next semaphore acuire to see if
> - *	we can break ACPI methods during testing.
> - */
> -void fwts_acpica_simulate_sem_timeout(int timeout)
> -{
> -	fwts_acpica_force_sem_timeout = timeout;
> -}
> -
>   /* ACPICA Handlers */
>
>   /*
> @@ -571,9 +560,6 @@ ACPI_STATUS AcpiOsWaitSemaphore(ACPI_HANDLE handle, UINT32 Units, UINT16 Timeout
>   	if (!handle)
>   		return AE_BAD_PARAMETER;
>
> -	if (fwts_acpica_force_sem_timeout)
> -		return AE_TIME;
> -
>   	switch (Timeout) {
>   	case 0:
>   		if (sem_trywait(&sem->sem))
> diff --git a/src/lib/include/fwts_acpica.h b/src/lib/include/fwts_acpica.h
> index 903d168..17a5988 100644
> --- a/src/lib/include/fwts_acpica.h
> +++ b/src/lib/include/fwts_acpica.h
> @@ -31,7 +31,6 @@ void fwts_acpica_debug_command(fwts_framework *fw, fwts_acpica_log_callback func
>   fwts_list *fwts_acpica_get_object_names(int type);
>   void fwts_acpica_sem_count_clear(void);
>   void fwts_acpica_sem_count_get(int *acquired, int *released);
> -void fwts_acpica_simulate_sem_timeout(int flag);
>   void fwts_acpi_region_handler_called_set(bool val);
>   bool fwts_acpi_region_handler_called_get(void);
>
>
Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 76b9f9e..f22447e 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -397,7 +397,6 @@  static int method_evaluate_method(fwts_framework *fw,
 				found++;
 				arg_list.Count   = num_args;
 				arg_list.Pointer = args;
-				fwts_acpica_simulate_sem_timeout(FWTS_FALSE);
 				method_evaluate_found_method(fw, method_name,
 					check_func, private, &arg_list);
 			}
diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
index 2c489f1..26b6a13 100644
--- a/src/acpica/fwts_acpica.c
+++ b/src/acpica/fwts_acpica.c
@@ -95,7 +95,6 @@  static ACPI_TABLE_FADT		*fwts_acpica_FADT;
 static void 			*fwts_acpica_DSDT;
 
 static fwts_framework		*fwts_acpica_fw;			/* acpica context copy of fw */
-static int			fwts_acpica_force_sem_timeout;		/* > 0, forces a semaphore timeout */
 static bool			fwts_acpica_init_called;		/* > 0, ACPICA initialised */
 static fwts_acpica_log_callback fwts_acpica_log_callback_func = NULL;	/* logging call back func */
 
@@ -179,16 +178,6 @@  void fwts_acpica_sem_count_get(int *acquired, int *released)
 	pthread_mutex_unlock(&mutex_lock_sem_table);
 }
 
-/*
- *  fwts_acpica_simulate_sem_timeout()
- *	force a timeout on next semaphore acuire to see if
- *	we can break ACPI methods during testing.
- */
-void fwts_acpica_simulate_sem_timeout(int timeout)
-{
-	fwts_acpica_force_sem_timeout = timeout;
-}
-
 /* ACPICA Handlers */
 
 /*
@@ -571,9 +560,6 @@  ACPI_STATUS AcpiOsWaitSemaphore(ACPI_HANDLE handle, UINT32 Units, UINT16 Timeout
 	if (!handle)
 		return AE_BAD_PARAMETER;
 
-	if (fwts_acpica_force_sem_timeout)
-		return AE_TIME;
-
 	switch (Timeout) {
 	case 0:
 		if (sem_trywait(&sem->sem))
diff --git a/src/lib/include/fwts_acpica.h b/src/lib/include/fwts_acpica.h
index 903d168..17a5988 100644
--- a/src/lib/include/fwts_acpica.h
+++ b/src/lib/include/fwts_acpica.h
@@ -31,7 +31,6 @@  void fwts_acpica_debug_command(fwts_framework *fw, fwts_acpica_log_callback func
 fwts_list *fwts_acpica_get_object_names(int type);
 void fwts_acpica_sem_count_clear(void);
 void fwts_acpica_sem_count_get(int *acquired, int *released);
-void fwts_acpica_simulate_sem_timeout(int flag);
 void fwts_acpi_region_handler_called_set(bool val);
 bool fwts_acpi_region_handler_called_get(void);