]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
util/logging: fix print format string
authorDaniel Wagner <wagi@kernel.org>
Mon, 17 Feb 2025 14:20:10 +0000 (15:20 +0100)
committerDaniel Wagner <wagi@monom.org>
Mon, 17 Feb 2025 14:25:00 +0000 (15:25 +0100)
Let's cast it to the longest type which works on 32bit and 64bit.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
util/logging.c

index 8e59948ec22d0d0dd026b89f6a102b56389d114e..a855a3dd67019bc486c800a694c93a75aa719fdf 100644 (file)
@@ -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,