Patchwork [09/18] bios: ebdadump: print format using inttypes

login
register
mail settings
Submitter Colin King
Date Sept. 23, 2012, 7:03 p.m.
Message ID <1348427041-4913-10-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/186261/
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/bios/ebdadump/ebdadump.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Keng-Yu Lin - Sept. 26, 2012, 10:08 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/bios/ebdadump/ebdadump.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/bios/ebdadump/ebdadump.c b/src/bios/ebdadump/ebdadump.c
> index d7ac4cd..48e9d96 100644
> --- a/src/bios/ebdadump/ebdadump.c
> +++ b/src/bios/ebdadump/ebdadump.c
> @@ -18,6 +18,8 @@
>   */
>
>  #include "fwts.h"
> +#include <stdint.h>
> +#include <inttypes.h>
>
>  #ifdef FWTS_ARCH_INTEL
>
> @@ -59,10 +61,10 @@ static int ebdadump_test1(fwts_framework *fw)
>                 return FWTS_ERROR;
>         }
>
> -       fwts_log_info(fw, "EBDA region: %x..%x (%d bytes)",
> -               (unsigned int)ebda_addr,
> +       fwts_log_info(fw, "EBDA region: %" PRIx32 "..%x (%zd bytes)",
> +               (uint32_t)ebda_addr,
>                 BIOS_ROM_START,
> -               (unsigned int)len);
> +               len);
>
>         ebdadump_data(fw, mem, ebda_addr, len);
>          (void)fwts_munmap(mem, len);
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Oct. 2, 2012, 2:27 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/bios/ebdadump/ebdadump.c |    8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/bios/ebdadump/ebdadump.c b/src/bios/ebdadump/ebdadump.c
> index d7ac4cd..48e9d96 100644
> --- a/src/bios/ebdadump/ebdadump.c
> +++ b/src/bios/ebdadump/ebdadump.c
> @@ -18,6 +18,8 @@
>    */
>
>   #include "fwts.h"
> +#include <stdint.h>
> +#include <inttypes.h>
>
>   #ifdef FWTS_ARCH_INTEL
>
> @@ -59,10 +61,10 @@ static int ebdadump_test1(fwts_framework *fw)
>   		return FWTS_ERROR;
>   	}
>
> -	fwts_log_info(fw, "EBDA region: %x..%x (%d bytes)",
> -		(unsigned int)ebda_addr,
> +	fwts_log_info(fw, "EBDA region: %" PRIx32 "..%x (%zd bytes)",
> +		(uint32_t)ebda_addr,
>   		BIOS_ROM_START,
> -		(unsigned int)len);
> +		len);
>
>   	ebdadump_data(fw, mem, ebda_addr, len);
>           (void)fwts_munmap(mem, len);
>

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

Patch

diff --git a/src/bios/ebdadump/ebdadump.c b/src/bios/ebdadump/ebdadump.c
index d7ac4cd..48e9d96 100644
--- a/src/bios/ebdadump/ebdadump.c
+++ b/src/bios/ebdadump/ebdadump.c
@@ -18,6 +18,8 @@ 
  */
 
 #include "fwts.h"
+#include <stdint.h>
+#include <inttypes.h>
 
 #ifdef FWTS_ARCH_INTEL
 
@@ -59,10 +61,10 @@  static int ebdadump_test1(fwts_framework *fw)
 		return FWTS_ERROR;
 	}
 
-	fwts_log_info(fw, "EBDA region: %x..%x (%d bytes)",
-		(unsigned int)ebda_addr,
+	fwts_log_info(fw, "EBDA region: %" PRIx32 "..%x (%zd bytes)",
+		(uint32_t)ebda_addr,
 		BIOS_ROM_START,
-		(unsigned int)len);
+		len);
 
 	ebdadump_data(fw, mem, ebda_addr, len);
         (void)fwts_munmap(mem, len);