]> git.baikalelectronics.ru Git - kernel.git/commit
tools: gpio: fix %llu warning in gpio-event-mon.c
authorKent Gibson <warthog618@gmail.com>
Thu, 7 Jan 2021 04:00:19 +0000 (12:00 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 18 Jan 2021 09:05:29 +0000 (10:05 +0100)
commit1acd4600000506fc7f8cfbec552e8c550e5761a3
treed4bec573ca34590e1f2b1ccdbff17e9f2abb2c39
parent87227852e90b41e590b27cdaa42801ffdff97ffa
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: 5a81bab6cea5 ("tools/gpio/gpio-event-mon: fix warning")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tools/gpio/gpio-event-mon.c