Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools: gpio: fix %llu warning in gpio-event-mon.c

Some platforms, such as mips64, don't map __u64 to long long unsigned
int so using %llu produces a warning:

gpio-event-mon.c:110:37: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=]
110 | fprintf(stdout, "GPIO EVENT at %llu on line %d (%d|%d) ",
| ~~~^
| |
| long long unsigned int
| %lu
111 | event.timestamp_ns, event.offset, event.line_seqno,
| ~~~~~~~~~~~~~~~~~~
| |
| __u64 {aka long unsigned int}

Replace the %llu with PRIu64 and cast the argument to uint64_t.

Fixes: 03fd11b03362 ("tools/gpio/gpio-event-mon: fix warning")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

authored by

Kent Gibson and committed by
Bartosz Golaszewski
2fe7c2f9 2e202ad8

+2 -2
+2 -2
tools/gpio/gpio-event-mon.c
··· 107 107 ret = -EIO; 108 108 break; 109 109 } 110 - fprintf(stdout, "GPIO EVENT at %llu on line %d (%d|%d) ", 111 - event.timestamp_ns, event.offset, event.line_seqno, 110 + fprintf(stdout, "GPIO EVENT at %" PRIu64 " on line %d (%d|%d) ", 111 + (uint64_t)event.timestamp_ns, event.offset, event.line_seqno, 112 112 event.seqno); 113 113 switch (event.id) { 114 114 case GPIO_V2_LINE_EVENT_RISING_EDGE: