[PATCH] acpi: method use correct format specifier for uint32_t type

Colin King colin.king at canonical.com
Mon Jun 12 15:02:48 UTC 2017


From: Colin Ian King <colin.king at canonical.com>

Use PRIu32 rather thad d as a format specifier for uint32_t type. Fixes
cppcheck warning:

(warning) %d in format string (no. 1) requires 'int' but the argument
type is 'unsigned int'.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/method/method.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 068aa5ed..b957f798 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -6464,7 +6464,7 @@ static int method_test_WAK(fwts_framework *fw)
 		ACPI_OBJECT arg[1];
 		char name[6];
 
-		snprintf(name, sizeof(name), "_S%1d_", i);
+		snprintf(name, sizeof(name), "_S%1" PRIu32 "_", i);
 		if (fwts_acpi_object_exists(name) == NULL)
 			continue;
 
-- 
2.11.0




More information about the fwts-devel mailing list