summaryrefslogtreecommitdiffstats
path: root/tools/gpio
diff options
context:
space:
mode:
authorKent Gibson <warthog618@gmail.com>2021-01-07 12:00:19 +0800
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2021-01-18 10:05:29 +0100
commit2fe7c2f99440d52613e1cf845c96e8e463c28111 (patch)
treed4bec573ca34590e1f2b1ccdbff17e9f2abb2c39 /tools/gpio
parent2e202ad873365513c6ad72e29a531071dffa498a (diff)
downloadlinux-2fe7c2f99440d52613e1cf845c96e8e463c28111.tar.gz
linux-2fe7c2f99440d52613e1cf845c96e8e463c28111.tar.bz2
linux-2fe7c2f99440d52613e1cf845c96e8e463c28111.zip
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>
Diffstat (limited to 'tools/gpio')
-rw-r--r--tools/gpio/gpio-event-mon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c
index cacd66ad7926..a2b233fdb572 100644
--- a/tools/gpio/gpio-event-mon.c
+++ b/tools/gpio/gpio-event-mon.c
@@ -107,8 +107,8 @@ int monitor_device(const char *device_name,
ret = -EIO;
break;
}
- fprintf(stdout, "GPIO EVENT at %llu on line %d (%d|%d) ",
- event.timestamp_ns, event.offset, event.line_seqno,
+ fprintf(stdout, "GPIO EVENT at %" PRIu64 " on line %d (%d|%d) ",
+ (uint64_t)event.timestamp_ns, event.offset, event.line_seqno,
event.seqno);
switch (event.id) {
case GPIO_V2_LINE_EVENT_RISING_EDGE: