Skip to content

Commit 359a3d1

Browse files
committed
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 <[email protected]>
1 parent b115720 commit 359a3d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

util/logging.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ static void nvme_show_command64(struct nvme_passthru_cmd64 *cmd, int err)
8181

8282
static void nvme_show_latency(struct timeval start, struct timeval end)
8383
{
84-
printf("latency : %lu us\n",
85-
(end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec));
84+
printf("latency : %llu us\n",
85+
(unsigned long long)((end.tv_sec - start.tv_sec) * 1000000 +
86+
(end.tv_usec - start.tv_usec)));
8687
}
8788

8889
int nvme_submit_passthru(int fd, unsigned long ioctl_cmd,

0 commit comments

Comments
 (0)