aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/vsock
diff options
context:
space:
mode:
authorMichal Luczaj <mhal@rbox.co>2024-12-19 10:49:28 +0100
committerJakub Kicinski <kuba@kernel.org>2024-12-23 10:28:00 -0800
commitf3af3ba1083836d174ada619366783fa17272f66 (patch)
treeceb8ed2116665d59237be7b925ddfe3f2ddf1fae /tools/testing/vsock
parentnetlink: correct nlmsg size for multicast notifications (diff)
downloadlinux-f3af3ba1083836d174ada619366783fa17272f66.tar.gz
linux-f3af3ba1083836d174ada619366783fa17272f66.zip
vsock/test: Use NSEC_PER_SEC
Replace 1000000000ULL with NSEC_PER_SEC. No functional change intended. Reviewed-by: Luigi Leonardi <leonardi@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Michal Luczaj <mhal@rbox.co> Link: https://patch.msgid.link/20241219-test-vsock-leaks-v4-1-a416e554d9d7@rbox.co Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/vsock')
-rw-r--r--tools/testing/vsock/vsock_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c
index 48f17641ca50..38fd8d96eb83 100644
--- a/tools/testing/vsock/vsock_test.c
+++ b/tools/testing/vsock/vsock_test.c
@@ -22,6 +22,7 @@
#include <signal.h>
#include <sys/ioctl.h>
#include <linux/sockios.h>
+#include <linux/time64.h>
#include "vsock_test_zerocopy.h"
#include "timeout.h"
@@ -559,7 +560,7 @@ static time_t current_nsec(void)
exit(EXIT_FAILURE);
}
- return (ts.tv_sec * 1000000000ULL) + ts.tv_nsec;
+ return (ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec;
}
#define RCVTIMEO_TIMEOUT_SEC 1
@@ -599,7 +600,7 @@ static void test_seqpacket_timeout_client(const struct test_opts *opts)
}
read_overhead_ns = current_nsec() - read_enter_ns -
- 1000000000ULL * RCVTIMEO_TIMEOUT_SEC;
+ NSEC_PER_SEC * RCVTIMEO_TIMEOUT_SEC;
if (read_overhead_ns > READ_OVERHEAD_NSEC) {
fprintf(stderr,