From: Daniel Wagner Date: Mon, 17 Feb 2025 14:20:10 +0000 (+0100) Subject: util/logging: fix print format string X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=359a3d179c9e51762a7005c85ce4b9d2ff98afce;p=users%2Fsagi%2Fnvme-cli.git util/logging: fix print format string Let's cast it to the longest type which works on 32bit and 64bit. Signed-off-by: Daniel Wagner --- diff --git a/util/logging.c b/util/logging.c index 8e59948e..a855a3dd 100644 --- a/util/logging.c +++ b/util/logging.c @@ -81,8 +81,9 @@ static void nvme_show_command64(struct nvme_passthru_cmd64 *cmd, int err) static void nvme_show_latency(struct timeval start, struct timeval end) { - printf("latency : %lu us\n", - (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec)); + printf("latency : %llu us\n", + (unsigned long long)((end.tv_sec - start.tv_sec) * 1000000 + + (end.tv_usec - start.tv_usec))); } int nvme_submit_passthru(int fd, unsigned long ioctl_cmd,