Skip to content

Commit

Permalink
util/logging: fix print format string
Browse files Browse the repository at this point in the history
Let's cast it to the longest type which works on 32bit and 64bit.

Signed-off-by: Daniel Wagner <[email protected]>
  • Loading branch information
igaw committed Feb 17, 2025
1 parent b115720 commit 359a3d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 359a3d1

Please sign in to comment.