Commit 03fd11b0 authored by Anders Roxell's avatar Anders Roxell Committed by Linus Walleij

tools/gpio/gpio-event-mon: fix warning

PRIu64 is defined in user space to match libc's uint64_t definition.
However, gpioevent_data structure in the kernel is defined using the
kernel's own __u64 type.

gpio-event-mon.c: In function ‘monitor_device’:
gpio-event-mon.c:102:19: warning: format ‘%lu’ expects argument of type
    ‘long unsigned int’, but argument 3 has type ‘__u64 {aka long long
    unsigned int}’ [-Wformat=]
   fprintf(stdout, "GPIO EVENT %" PRIu64 ": ", event.timestamp);
                   ^~~~~~~~~~~~~~
  LD       /tmp/kselftest/gpiogpio-event-mon-in.o
  LINK     /tmp/kselftest/gpiogpio-event-mon

Fix is to replace PRIu64 with llu, which we know is what the kernel uses
for __u64.
Signed-off-by: default avatarAnders Roxell <anders.roxell@linaro.org>
Tested-by: default avatarDaniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent b995ff3b
......@@ -99,7 +99,7 @@ int monitor_device(const char *device_name,
ret = -EIO;
break;
}
fprintf(stdout, "GPIO EVENT %" PRIu64 ": ", event.timestamp);
fprintf(stdout, "GPIO EVENT %llu: ", event.timestamp);
switch (event.id) {
case GPIOEVENT_EVENT_RISING_EDGE:
fprintf(stdout, "rising edge");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment