Patchwork [1/2] lib: fwts_acpi_method: gather all object names rather than just method names

login
register
mail settings
Submitter Colin King
Date April 18, 2012, 11:41 a.m.
Message ID <1334749269-31162-2-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/153481/
State Rejected
Headers show

Comments

Colin King - April 18, 2012, 11:41 a.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_acpi_method.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
Alex Hung - April 19, 2012, 2:47 a.m.
On 04/18/2012 07:41 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/lib/src/fwts_acpi_method.c |   13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
> index 885c8c8..7a55ccd 100644
> --- a/src/lib/src/fwts_acpi_method.c
> +++ b/src/lib/src/fwts_acpi_method.c
> @@ -110,7 +110,7 @@ static acpi_eval_error  errors[] = {
>   };
>
>
> -static fwts_list *fwts_method_names;
> +static fwts_list *fwts_object_names;
>   static bool fwts_method_initialized = false;
>
>
> @@ -123,7 +123,8 @@ int fwts_method_init(fwts_framework *fw)
>   	if (fwts_acpica_init(fw) != FWTS_OK)
>   		return FWTS_ERROR;
>
> -	fwts_method_names = fwts_acpica_get_object_names(8);
> +	/* Gather all object names */
> +	fwts_object_names = fwts_acpica_get_object_names(0);
>   	fwts_method_initialized = true;
>
>   	return FWTS_OK;
> @@ -138,8 +139,8 @@ int fwts_method_deinit(fwts_framework *fw)
>   	int ret = FWTS_ERROR;
>
>   	if (fwts_method_initialized) {
> -		fwts_list_free(fwts_method_names, free);
> -		fwts_method_names = NULL;
> +		fwts_list_free(fwts_object_names, free);
> +		fwts_object_names = NULL;
>   		ret = fwts_acpica_deinit();
>
>   		fwts_method_initialized = false;
> @@ -155,7 +156,7 @@ int fwts_method_deinit(fwts_framework *fw)
>    */
>   fwts_list *fwts_method_get_names(void)
>   {
> -	return fwts_method_names;
> +	return fwts_object_names;
>   }
>
>   /*
> @@ -167,7 +168,7 @@ char *fwts_method_exists(char *name)
>   	size_t name_len = strlen(name);
>   	fwts_list_link	*item;
>
> -	fwts_list_foreach(item, fwts_method_names) {
> +	fwts_list_foreach(item, fwts_object_names) {
>   		char *method_name = fwts_list_data(char*, item);
>   		size_t len = strlen(method_name);
>

Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
index 885c8c8..7a55ccd 100644
--- a/src/lib/src/fwts_acpi_method.c
+++ b/src/lib/src/fwts_acpi_method.c
@@ -110,7 +110,7 @@  static acpi_eval_error  errors[] = {
 };
 
 
-static fwts_list *fwts_method_names;
+static fwts_list *fwts_object_names;
 static bool fwts_method_initialized = false;
 
 
@@ -123,7 +123,8 @@  int fwts_method_init(fwts_framework *fw)
 	if (fwts_acpica_init(fw) != FWTS_OK)
 		return FWTS_ERROR;
 
-	fwts_method_names = fwts_acpica_get_object_names(8);
+	/* Gather all object names */
+	fwts_object_names = fwts_acpica_get_object_names(0);
 	fwts_method_initialized = true;
 
 	return FWTS_OK;
@@ -138,8 +139,8 @@  int fwts_method_deinit(fwts_framework *fw)
 	int ret = FWTS_ERROR;
 
 	if (fwts_method_initialized) {
-		fwts_list_free(fwts_method_names, free);
-		fwts_method_names = NULL;
+		fwts_list_free(fwts_object_names, free);
+		fwts_object_names = NULL;
 		ret = fwts_acpica_deinit();
 
 		fwts_method_initialized = false;
@@ -155,7 +156,7 @@  int fwts_method_deinit(fwts_framework *fw)
  */
 fwts_list *fwts_method_get_names(void)
 {
-	return fwts_method_names;
+	return fwts_object_names;
 }
 
 /*  
@@ -167,7 +168,7 @@  char *fwts_method_exists(char *name)
 	size_t name_len = strlen(name);
 	fwts_list_link	*item;
 
-	fwts_list_foreach(item, fwts_method_names) {
+	fwts_list_foreach(item, fwts_object_names) {
 		char *method_name = fwts_list_data(char*, item);
 		size_t len = strlen(method_name);