lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241113021458.291252-1-luoyifan@cmss.chinamobile.com>
Date: Wed, 13 Nov 2024 10:14:58 +0800
From: Luo Yifan <luoyifan@...s.chinamobile.com>
To: brgl@...ev.pl,
	warthog618@...il.com
Cc: linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Luo Yifan <luoyifan@...s.chinamobile.com>
Subject: [PATCH] tools: gpio: Fix several incorrect format specifiers

Make a minor change to eliminate static checker warnings. The variable
lines[] is unsigned, so the correct format specifier should be %u
instead of %d.

Signed-off-by: Luo Yifan <luoyifan@...s.chinamobile.com>
---
 tools/gpio/gpio-event-mon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c
index 5dee2b98a..b70813b0b 100644
--- a/tools/gpio/gpio-event-mon.c
+++ b/tools/gpio/gpio-event-mon.c
@@ -69,14 +69,14 @@ int monitor_device(const char *device_name,
 	}
 
 	if (num_lines == 1) {
-		fprintf(stdout, "Monitoring line %d on %s\n", lines[0], device_name);
+		fprintf(stdout, "Monitoring line %u on %s\n", lines[0], device_name);
 		fprintf(stdout, "Initial line value: %d\n",
 			gpiotools_test_bit(values.bits, 0));
 	} else {
-		fprintf(stdout, "Monitoring lines %d", lines[0]);
+		fprintf(stdout, "Monitoring lines %u", lines[0]);
 		for (i = 1; i < num_lines - 1; i++)
-			fprintf(stdout, ", %d", lines[i]);
-		fprintf(stdout, " and %d on %s\n", lines[i], device_name);
+			fprintf(stdout, ", %u", lines[i]);
+		fprintf(stdout, " and %u on %s\n", lines[i], device_name);
 		fprintf(stdout, "Initial line values: %d",
 			gpiotools_test_bit(values.bits, 0));
 		for (i = 1; i < num_lines - 1; i++)
-- 
2.27.0




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ