diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-19 19:13:35 +0100 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-20 14:45:33 +0100 |
commit | 9cda268b981d1c7a54adc7930790cd031196d0b8 (patch) | |
tree | 3ed99e3096513b7b7b148dce0059199494631ba9 | |
parent | 02efb34c1afa27073094e189f13dcdc9760cba55 (diff) |
tools/testing/selftests/timens/: Don't redefine ARRAY_SIZE()
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r-- | tools/testing/selftests/timens/procfs.c | 6 | ||||
-rw-r--r-- | tools/testing/selftests/timens/timens.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tools/testing/selftests/timens/procfs.c b/tools/testing/selftests/timens/procfs.c index f2519154208a..9dd66097d9c0 100644 --- a/tools/testing/selftests/timens/procfs.c +++ b/tools/testing/selftests/timens/procfs.c @@ -1,7 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 + + #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> +#include <linux/array_size.h> #include <math.h> #include <sched.h> #include <stdio.h> @@ -16,6 +19,7 @@ #include "log.h" #include "timens.h" + /* * Test shouldn't be run for a day, so add 10 days to child * time and check parent's time to be in the same day. @@ -24,8 +28,6 @@ #define DAY_IN_SEC (60*60*24) #define TEN_DAYS_IN_SEC (10*DAY_IN_SEC) -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - static int child_ns, parent_ns; static int switch_ns(int fd) diff --git a/tools/testing/selftests/timens/timens.c b/tools/testing/selftests/timens/timens.c index 52b6a1185f52..c6dafceebc28 100644 --- a/tools/testing/selftests/timens/timens.c +++ b/tools/testing/selftests/timens/timens.c @@ -1,7 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 + + #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> +#include <linux/array_size.h> #include <sched.h> #include <stdio.h> #include <stdbool.h> @@ -15,6 +18,7 @@ #include "log.h" #include "timens.h" + /* * Test shouldn't be run for a day, so add 10 days to child * time and check parent's time to be in the same day. @@ -22,8 +26,6 @@ #define DAY_IN_SEC (60*60*24) #define TEN_DAYS_IN_SEC (10*DAY_IN_SEC) -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - struct test_clock { clockid_t id; char *name; |