From: Zhu Jun Date: Wed, 24 Jul 2024 02:46:36 +0000 (-0700) Subject: tools: gpio: Fix the wrong format specifier X-Git-Tag: v6.12-rc1~156^2~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac93ca125b5409df56c5139648bbe10fd1ea989b;p=thirdparty%2Fkernel%2Flinux.git tools: gpio: Fix the wrong format specifier The unsigned int should use "%u" instead of "%d". Signed-off-by: Zhu Jun Link: https://lore.kernel.org/r/20240724024636.3634-1-zhujun2@cmss.chinamobile.com Signed-off-by: Bartosz Golaszewski --- diff --git a/tools/gpio/gpio-hammer.c b/tools/gpio/gpio-hammer.c index 54fdf59dd320d..ba0866eb35814 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, ", ");