• Kent Gibson's avatar
    tools: gpio: fix %llu warning in gpio-event-mon.c · 2fe7c2f9
    Kent Gibson authored
    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: 03fd11b0 ("tools/gpio/gpio-event-mon: fix warning")
    Signed-off-by: default avatarKent Gibson <warthog618@gmail.com>
    Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
    2fe7c2f9
gpio-event-mon.c 5.71 KB