diff mbox

acpi: nfit: change %x to marco PRIx32 for portability

Message ID 1471225223-28136-1-git-send-email-alex.hung@canonical.com
State Accepted
Headers show

Commit Message

Alex Hung Aug. 15, 2016, 1:40 a.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/nfit/nfit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Colin Ian King Aug. 15, 2016, 8:10 a.m. UTC | #1
On 15/08/16 02:40, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/nfit/nfit.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
> index 253070e..ae115b5 100644
> --- a/src/acpi/nfit/nfit.c
> +++ b/src/acpi/nfit/nfit.c
> @@ -51,7 +51,7 @@ static int nfit_test1(fwts_framework *fw)
>  {
>  	fwts_acpi_table_nfit *nfit = (fwts_acpi_table_nfit*) table->data;
>  	fwts_acpi_table_nfit_struct_header *entry;
> -	size_t offset;
> +	uint32_t offset;
>  	bool passed = true;
>  
>  	fwts_log_info_verbatim(fw, "NFIT NVDIMM Firmware Interface Table:");
> @@ -79,8 +79,8 @@ static int nfit_test1(fwts_framework *fw)
>  		if (entry->length == 0) {
>  			passed = false;
>  			fwts_failed(fw, LOG_LEVEL_HIGH, "NFITLengthZero",
> -				    "NFIT Subtable (offset 0x%x) length "
> -				    "cannot be 0", (int)offset);
> +				    "NFIT Subtable (offset 0x%4.4" PRIx32 ") "
> +				    "length cannot be 0", offset);
>  			break;
>  		}
>  
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu Aug. 16, 2016, 9:18 a.m. UTC | #2
On 2016年08月15日 09:40, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   src/acpi/nfit/nfit.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
> index 253070e..ae115b5 100644
> --- a/src/acpi/nfit/nfit.c
> +++ b/src/acpi/nfit/nfit.c
> @@ -51,7 +51,7 @@ static int nfit_test1(fwts_framework *fw)
>   {
>   	fwts_acpi_table_nfit *nfit = (fwts_acpi_table_nfit*) table->data;
>   	fwts_acpi_table_nfit_struct_header *entry;
> -	size_t offset;
> +	uint32_t offset;
>   	bool passed = true;
>   
>   	fwts_log_info_verbatim(fw, "NFIT NVDIMM Firmware Interface Table:");
> @@ -79,8 +79,8 @@ static int nfit_test1(fwts_framework *fw)
>   		if (entry->length == 0) {
>   			passed = false;
>   			fwts_failed(fw, LOG_LEVEL_HIGH, "NFITLengthZero",
> -				    "NFIT Subtable (offset 0x%x) length "
> -				    "cannot be 0", (int)offset);
> +				    "NFIT Subtable (offset 0x%4.4" PRIx32 ") "
> +				    "length cannot be 0", offset);
>   			break;
>   		}
>   
Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
index 253070e..ae115b5 100644
--- a/src/acpi/nfit/nfit.c
+++ b/src/acpi/nfit/nfit.c
@@ -51,7 +51,7 @@  static int nfit_test1(fwts_framework *fw)
 {
 	fwts_acpi_table_nfit *nfit = (fwts_acpi_table_nfit*) table->data;
 	fwts_acpi_table_nfit_struct_header *entry;
-	size_t offset;
+	uint32_t offset;
 	bool passed = true;
 
 	fwts_log_info_verbatim(fw, "NFIT NVDIMM Firmware Interface Table:");
@@ -79,8 +79,8 @@  static int nfit_test1(fwts_framework *fw)
 		if (entry->length == 0) {
 			passed = false;
 			fwts_failed(fw, LOG_LEVEL_HIGH, "NFITLengthZero",
-				    "NFIT Subtable (offset 0x%x) length "
-				    "cannot be 0", (int)offset);
+				    "NFIT Subtable (offset 0x%4.4" PRIx32 ") "
+				    "length cannot be 0", offset);
 			break;
 		}