diff mbox

acpi: xsdt: fix build error on 32 bit systems

Message ID 20170824103004.21100-1-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King Aug. 24, 2017, 10:30 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Use PRIu64 rather than lx to print the address. Also minor change
to else formatting.

Fixes build error:
acpi/xsdt/xsdt.c: In function ‘xsdt_test1’:
acpi/xsdt/xsdt.c:84:4: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 7 has type ‘uint64_t’ [-Werror=format=]
    fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%lx"
    ^

Fixes: fcc5f1e9fbc7 ("acpi: xsdt: add SBBR compliance tests)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/xsdt/xsdt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Alex Hung Aug. 24, 2017, 6:47 p.m. UTC | #1
On 2017-08-24 03:30 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Use PRIu64 rather than lx to print the address. Also minor change
> to else formatting.
> 
> Fixes build error:
> acpi/xsdt/xsdt.c: In function ‘xsdt_test1’:
> acpi/xsdt/xsdt.c:84:4: error: format ‘%lx’ expects argument of type
> ‘long unsigned int’, but argument 7 has type ‘uint64_t’ [-Werror=format=]
>      fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%lx"
>      ^
> 
> Fixes: fcc5f1e9fbc7 ("acpi: xsdt: add SBBR compliance tests)
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/xsdt/xsdt.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/xsdt/xsdt.c b/src/acpi/xsdt/xsdt.c
> index 2c515fda..97f5c5eb 100644
> --- a/src/acpi/xsdt/xsdt.c
> +++ b/src/acpi/xsdt/xsdt.c
> @@ -81,11 +81,10 @@ static int xsdt_test1(fwts_framework *fw)
>   	}
>   	if (passed) {
>   		if (fw->flags & FWTS_FLAG_TEST_SBBR) {
> -			fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%lx"
> +			fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%" PRIx64
>   				" and contain valid pointers to %d other ACPI tables mandated by SBBR",
>   				 xsdt->entries[0], (int)n);
> -		}
> -		else
> +		} else
>   			fwts_passed(fw, "No issues found in XSDT table.");
>   	}
>   
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 25, 2017, 7:09 a.m. UTC | #2
On 08/24/2017 06:30 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Use PRIu64 rather than lx to print the address. Also minor change
> to else formatting.
> 
> Fixes build error:
> acpi/xsdt/xsdt.c: In function ‘xsdt_test1’:
> acpi/xsdt/xsdt.c:84:4: error: format ‘%lx’ expects argument of type
> ‘long unsigned int’, but argument 7 has type ‘uint64_t’ [-Werror=format=]
>      fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%lx"
>      ^
> 
> Fixes: fcc5f1e9fbc7 ("acpi: xsdt: add SBBR compliance tests)
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/xsdt/xsdt.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/xsdt/xsdt.c b/src/acpi/xsdt/xsdt.c
> index 2c515fda..97f5c5eb 100644
> --- a/src/acpi/xsdt/xsdt.c
> +++ b/src/acpi/xsdt/xsdt.c
> @@ -81,11 +81,10 @@ static int xsdt_test1(fwts_framework *fw)
>   	}
>   	if (passed) {
>   		if (fw->flags & FWTS_FLAG_TEST_SBBR) {
> -			fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%lx"
> +			fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%" PRIx64
>   				" and contain valid pointers to %d other ACPI tables mandated by SBBR",
>   				 xsdt->entries[0], (int)n);
> -		}
> -		else
> +		} else
>   			fwts_passed(fw, "No issues found in XSDT table.");
>   	}
>   
> 

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

Patch

diff --git a/src/acpi/xsdt/xsdt.c b/src/acpi/xsdt/xsdt.c
index 2c515fda..97f5c5eb 100644
--- a/src/acpi/xsdt/xsdt.c
+++ b/src/acpi/xsdt/xsdt.c
@@ -81,11 +81,10 @@  static int xsdt_test1(fwts_framework *fw)
 	}
 	if (passed) {
 		if (fw->flags & FWTS_FLAG_TEST_SBBR) {
-			fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%lx"
+			fwts_passed(fw, "XSDT is present, pointed at by XsdrAddress=0x%" PRIx64
 				" and contain valid pointers to %d other ACPI tables mandated by SBBR",
 				 xsdt->entries[0], (int)n);
-		}
-		else
+		} else
 			fwts_passed(fw, "No issues found in XSDT table.");
 	}