Skip to content

Commit f3af3ba

Browse files
mmhalkuba-moo
authored andcommitted
vsock/test: Use NSEC_PER_SEC
Replace 1000000000ULL with NSEC_PER_SEC. No functional change intended. Reviewed-by: Luigi Leonardi <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]> Signed-off-by: Michal Luczaj <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent aa4ad7c commit f3af3ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/testing/vsock/vsock_test.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <signal.h>
2323
#include <sys/ioctl.h>
2424
#include <linux/sockios.h>
25+
#include <linux/time64.h>
2526

2627
#include "vsock_test_zerocopy.h"
2728
#include "timeout.h"
@@ -559,7 +560,7 @@ static time_t current_nsec(void)
559560
exit(EXIT_FAILURE);
560561
}
561562

562-
return (ts.tv_sec * 1000000000ULL) + ts.tv_nsec;
563+
return (ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec;
563564
}
564565

565566
#define RCVTIMEO_TIMEOUT_SEC 1
@@ -599,7 +600,7 @@ static void test_seqpacket_timeout_client(const struct test_opts *opts)
599600
}
600601

601602
read_overhead_ns = current_nsec() - read_enter_ns -
602-
1000000000ULL * RCVTIMEO_TIMEOUT_SEC;
603+
NSEC_PER_SEC * RCVTIMEO_TIMEOUT_SEC;
603604

604605
if (read_overhead_ns > READ_OVERHEAD_NSEC) {
605606
fprintf(stderr,

0 commit comments

Comments
 (0)