Patchwork acpi: method: use size_t instead of int

login
register
mail settings
Submitter Colin King
Date April 10, 2012, 2:31 p.m.
Message ID <1334068278-2158-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/151589/
State Accepted
Headers show

Comments

Colin King - April 10, 2012, 2:31 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/method/method.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Alex Hung - April 11, 2012, 2:47 a.m.
On 04/10/2012 10:31 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/acpi/method/method.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index abf82ed..6797868 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -254,13 +254,13 @@ static int method_evaluate_method(fwts_framework *fw,
>   {
>   	fwts_list_link	*item;
>   	fwts_list *methods;
> -	int name_len = strlen(name);
> +	size_t name_len = strlen(name);
>   	int found = 0;
>
>    	if ((methods = fwts_method_get_names()) != NULL) {
>   		fwts_list_foreach(item, methods) {
>   			char *method_name = fwts_list_data(char*, item);
> -			int len = strlen(method_name);
> +			size_t len = strlen(method_name);
>   			if (strncmp(name, method_name + len - name_len, name_len) == 0) {
>   				ACPI_OBJECT_LIST  arg_list;
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - April 11, 2012, 5:13 a.m.
On Wed, Apr 11, 2012 at 10:47 AM, Alex Hung <alex.hung@canonical.com> wrote:
> On 04/10/2012 10:31 PM, Colin King wrote:
>>
>> From: Colin Ian King<colin.king@canonical.com>
>>
>> Signed-off-by: Colin Ian King<colin.king@canonical.com>
>> ---
>>  src/acpi/method/method.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
>> index abf82ed..6797868 100644
>> --- a/src/acpi/method/method.c
>> +++ b/src/acpi/method/method.c
>> @@ -254,13 +254,13 @@ static int method_evaluate_method(fwts_framework
>> *fw,
>>  {
>>        fwts_list_link  *item;
>>        fwts_list *methods;
>> -       int name_len = strlen(name);
>> +       size_t name_len = strlen(name);
>>        int found = 0;
>>
>>        if ((methods = fwts_method_get_names()) != NULL) {
>>                fwts_list_foreach(item, methods) {
>>                        char *method_name = fwts_list_data(char*, item);
>> -                       int len = strlen(method_name);
>> +                       size_t len = strlen(method_name);
>>                        if (strncmp(name, method_name + len - name_len,
>> name_len) == 0) {
>>                                ACPI_OBJECT_LIST  arg_list;
>>
> Acked-by: Alex Hung <alex.hung@canonical.com>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index abf82ed..6797868 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -254,13 +254,13 @@  static int method_evaluate_method(fwts_framework *fw,
 {
 	fwts_list_link	*item;
 	fwts_list *methods;
-	int name_len = strlen(name);
+	size_t name_len = strlen(name);
 	int found = 0;
 
  	if ((methods = fwts_method_get_names()) != NULL) {
 		fwts_list_foreach(item, methods) {
 			char *method_name = fwts_list_data(char*, item);
-			int len = strlen(method_name);
+			size_t len = strlen(method_name);
 			if (strncmp(name, method_name + len - name_len, name_len) == 0) {
 				ACPI_OBJECT_LIST  arg_list;