Skip to content

Commit b6621b1

Browse files
Luo YifanBartosz Golaszewski
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 65e9363 commit b6621b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/gpio/gpio-event-mon.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ int monitor_device(const char *device_name,
6969
}
7070

7171
if (num_lines == 1) {
72-
fprintf(stdout, "Monitoring line %d on %s\n", lines[0], device_name);
72+
fprintf(stdout, "Monitoring line %u on %s\n", lines[0], device_name);
7373
fprintf(stdout, "Initial line value: %d\n",
7474
gpiotools_test_bit(values.bits, 0));
7575
} else {
76-
fprintf(stdout, "Monitoring lines %d", lines[0]);
76+
fprintf(stdout, "Monitoring lines %u", lines[0]);
7777
for (i = 1; i < num_lines - 1; i++)
78-
fprintf(stdout, ", %d", lines[i]);
79-
fprintf(stdout, " and %d on %s\n", lines[i], device_name);
78+
fprintf(stdout, ", %u", lines[i]);
79+
fprintf(stdout, " and %u on %s\n", lines[i], device_name);
8080
fprintf(stdout, "Initial line values: %d",
8181
gpiotools_test_bit(values.bits, 0));
8282
for (i = 1; i < num_lines - 1; i++)

0 commit comments

Comments
 (0)