Patchwork [04/18] acpi: fadt: print format using inttypes

login
register
mail settings
Submitter Colin King
Date Sept. 23, 2012, 7:03 p.m.
Message ID <1348427041-4913-5-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/186253/
State Accepted
Headers show

Comments

Colin King - Sept. 23, 2012, 7:03 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/fadt/fadt.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Keng-Yu Lin - Sept. 25, 2012, 10:06 a.m.
On Mon, Sep 24, 2012 at 3:03 AM, 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/fadt/fadt.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
> index 22dc341..e14d7be 100644
> --- a/src/acpi/fadt/fadt.c
> +++ b/src/acpi/fadt/fadt.c
> @@ -28,6 +28,7 @@
>  #include <sys/stat.h>
>  #include <sys/io.h>
>  #include <unistd.h>
> +#include <inttypes.h>
>  #include <string.h>
>
>  static const fwts_acpi_table_fadt *fadt;
> @@ -75,8 +76,8 @@ static int fadt_test1(fwts_framework *fw)
>                 if ((uint64_t)port != fadt->x_pm1a_cnt_blk.address) {
>                         fwts_failed(fw, LOG_LEVEL_MEDIUM,
>                                 "FADTPM1CNTAddrMismatch",
> -                               "32 and 64 bit versions of FADT pm1_cnt address do not match (0x%8.8x vs 0x%16.16llx).",
> -                               port, (unsigned long long int)fadt->x_pm1a_cnt_blk.address);
> +                               "32 and 64 bit versions of FADT pm1_cnt address do not match (0x%8.8x vs 0x%16.16" PRIx64 ").",
> +                               port, fadt->x_pm1a_cnt_blk.address);
>                         fwts_tag_failed(fw, FWTS_TAG_ACPI_BAD_ADDRESS);
>                 }
>                 if (width != fadt->x_pm1a_cnt_blk.register_bit_width) {
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Oct. 2, 2012, 2:13 a.m.
On 09/24/2012 03:03 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/fadt/fadt.c |    5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
> index 22dc341..e14d7be 100644
> --- a/src/acpi/fadt/fadt.c
> +++ b/src/acpi/fadt/fadt.c
> @@ -28,6 +28,7 @@
>   #include <sys/stat.h>
>   #include <sys/io.h>
>   #include <unistd.h>
> +#include <inttypes.h>
>   #include <string.h>
>
>   static const fwts_acpi_table_fadt *fadt;
> @@ -75,8 +76,8 @@ static int fadt_test1(fwts_framework *fw)
>   		if ((uint64_t)port != fadt->x_pm1a_cnt_blk.address) {
>   			fwts_failed(fw, LOG_LEVEL_MEDIUM,
>   				"FADTPM1CNTAddrMismatch",
> -				"32 and 64 bit versions of FADT pm1_cnt address do not match (0x%8.8x vs 0x%16.16llx).",
> -				port, (unsigned long long int)fadt->x_pm1a_cnt_blk.address);
> +				"32 and 64 bit versions of FADT pm1_cnt address do not match (0x%8.8x vs 0x%16.16" PRIx64 ").",
> +				port, fadt->x_pm1a_cnt_blk.address);
>   			fwts_tag_failed(fw, FWTS_TAG_ACPI_BAD_ADDRESS);
>   		}
>   		if (width != fadt->x_pm1a_cnt_blk.register_bit_width) {
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index 22dc341..e14d7be 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -28,6 +28,7 @@ 
 #include <sys/stat.h>
 #include <sys/io.h>
 #include <unistd.h>
+#include <inttypes.h>
 #include <string.h>
 
 static const fwts_acpi_table_fadt *fadt;
@@ -75,8 +76,8 @@  static int fadt_test1(fwts_framework *fw)
 		if ((uint64_t)port != fadt->x_pm1a_cnt_blk.address) {
 			fwts_failed(fw, LOG_LEVEL_MEDIUM,
 				"FADTPM1CNTAddrMismatch",
-				"32 and 64 bit versions of FADT pm1_cnt address do not match (0x%8.8x vs 0x%16.16llx).",
-				port, (unsigned long long int)fadt->x_pm1a_cnt_blk.address);
+				"32 and 64 bit versions of FADT pm1_cnt address do not match (0x%8.8x vs 0x%16.16" PRIx64 ").",
+				port, fadt->x_pm1a_cnt_blk.address);
 			fwts_tag_failed(fw, FWTS_TAG_ACPI_BAD_ADDRESS);
 		}
 		if (width != fadt->x_pm1a_cnt_blk.register_bit_width) {