diff mbox series

tools/gpio:Fix the wrong format specifier

Message ID 20240724024636.3634-1-zhujun2@cmss.chinamobile.com
State New
Headers show
Series tools/gpio:Fix the wrong format specifier | expand

Commit Message

Zhu Jun July 24, 2024, 2:46 a.m. UTC
The unsigned int should use "%u" instead of "%d".

Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 tools/gpio/gpio-hammer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bartosz Golaszewski July 31, 2024, 7:57 a.m. UTC | #1
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Tue, 23 Jul 2024 19:46:36 -0700, Zhu Jun wrote:
> The unsigned int should use "%u" instead of "%d".
> 
> 

Applied, thanks!

[1/1] tools/gpio:Fix the wrong format specifier
      commit: ac93ca125b5409df56c5139648bbe10fd1ea989b

Best regards,
diff mbox series

Patch

diff --git a/tools/gpio/gpio-hammer.c b/tools/gpio/gpio-hammer.c
index 54fdf59dd320..ba0866eb3581 100644
--- a/tools/gpio/gpio-hammer.c
+++ b/tools/gpio/gpio-hammer.c
@@ -54,7 +54,7 @@  int hammer_device(const char *device_name, unsigned int *lines, int num_lines,
 
 	fprintf(stdout, "Hammer lines [");
 	for (i = 0; i < num_lines; i++) {
-		fprintf(stdout, "%d", lines[i]);
+		fprintf(stdout, "%u", lines[i]);
 		if (i != (num_lines - 1))
 			fprintf(stdout, ", ");
 	}
@@ -89,7 +89,7 @@  int hammer_device(const char *device_name, unsigned int *lines, int num_lines,
 
 		fprintf(stdout, "[");
 		for (i = 0; i < num_lines; i++) {
-			fprintf(stdout, "%d: %d", lines[i],
+			fprintf(stdout, "%u: %d", lines[i],
 				gpiotools_test_bit(values.bits, i));
 			if (i != (num_lines - 1))
 				fprintf(stdout, ", ");