Patchwork [RESUBMIT] acpi: acpidump: remove unnecessary variable n

login
register
mail settings
Submitter Colin King
Date April 11, 2012, 8:08 a.m.
Message ID <1334131730-14252-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/151739/
State Accepted
Headers show

Comments

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

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/acpidump/acpidump.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Alex Hung - April 11, 2012, 8:09 a.m.
On 04/11/2012 04:08 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c |    5 ++---
>   1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index 6b20ca7..28a43b0 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -665,7 +665,6 @@ static void acpidump_xsdt(fwts_framework *fw, uint8_t *data, int length)
>   static void acpidump_madt(fwts_framework *fw, uint8_t *data, int length)
>   {
>   	int i = 0;
> -	int n;
>   	int offset = 0;
>
>   	fwts_acpidump_field fields[] = {
> @@ -788,8 +787,8 @@ static void acpidump_madt(fwts_framework *fw, uint8_t *data, int length)
>   				};
>   				fwts_log_info_verbatum(fw, " Local SAPIC:");
>   				__acpi_dump_table_fields(fw, data, fields_madt_local_sapic, offset);
> -				n = strlen(local_sapic->uid_string) + 1;
> -				skip = (sizeof(fwts_acpi_madt_local_sapic) + n);
> +				skip = (sizeof(fwts_acpi_madt_local_sapic) +
> +					strlen(local_sapic->uid_string) + 1);
>   			}
>   			break;
>   		case 8: {
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - April 11, 2012, 8:17 a.m.
On Wed, Apr 11, 2012 at 4:08 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/acpidump/acpidump.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index 6b20ca7..28a43b0 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -665,7 +665,6 @@ static void acpidump_xsdt(fwts_framework *fw, uint8_t *data, int length)
>  static void acpidump_madt(fwts_framework *fw, uint8_t *data, int length)
>  {
>        int i = 0;
> -       int n;
>        int offset = 0;
>
>        fwts_acpidump_field fields[] = {
> @@ -788,8 +787,8 @@ static void acpidump_madt(fwts_framework *fw, uint8_t *data, int length)
>                                };
>                                fwts_log_info_verbatum(fw, " Local SAPIC:");
>                                __acpi_dump_table_fields(fw, data, fields_madt_local_sapic, offset);
> -                               n = strlen(local_sapic->uid_string) + 1;
> -                               skip = (sizeof(fwts_acpi_madt_local_sapic) + n);
> +                               skip = (sizeof(fwts_acpi_madt_local_sapic) +
> +                                       strlen(local_sapic->uid_string) + 1);
>                        }
>                        break;
>                case 8: {
> --
> 1.7.9.1
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
index 6b20ca7..28a43b0 100644
--- a/src/acpi/acpidump/acpidump.c
+++ b/src/acpi/acpidump/acpidump.c
@@ -665,7 +665,6 @@  static void acpidump_xsdt(fwts_framework *fw, uint8_t *data, int length)
 static void acpidump_madt(fwts_framework *fw, uint8_t *data, int length)
 {
 	int i = 0;
-	int n;
 	int offset = 0;
 
 	fwts_acpidump_field fields[] = {
@@ -788,8 +787,8 @@  static void acpidump_madt(fwts_framework *fw, uint8_t *data, int length)
 				};
 				fwts_log_info_verbatum(fw, " Local SAPIC:");
 				__acpi_dump_table_fields(fw, data, fields_madt_local_sapic, offset);
-				n = strlen(local_sapic->uid_string) + 1;
-				skip = (sizeof(fwts_acpi_madt_local_sapic) + n);
+				skip = (sizeof(fwts_acpi_madt_local_sapic) +
+					strlen(local_sapic->uid_string) + 1);
 			}
 			break;
 		case 8: {