While the hardcoded constants are correct, they are not obvious when
reading the code.

Switch to symbolic identifiers.

Signed-off-by: Thomas Weißschuh <[email protected]>
---
 .../testing/selftests/vDSO/vdso_test_correctness.c | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c 
b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index bcce5053e822..3671ea815823 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -255,18 +255,18 @@ static const struct {
        clockid_t id;
        const char *const name;
 } clocks[] = {
-       { 0,    "CLOCK_REALTIME"},
-       { 1,    "CLOCK_MONOTONIC"},
-       { 2,    "CLOCK_PROCESS_CPUTIME_ID"},
-       { 3,    "CLOCK_THREAD_CPUTIME_ID"},
-       { 4,    "CLOCK_MONOTONIC_RAW"},
-       { 5,    "CLOCK_REALTIME_COARSE"},
-       { 6,    "CLOCK_MONOTONIC_COARSE"},
-       { 7,    "CLOCK_BOOTTIME"},
-       { 8,    "CLOCK_REALTIME_ALARM"},
-       { 9,    "CLOCK_BOOTTIME_ALARM"},
-       { 10,   "CLOCK_SGI_CYCLE"},
-       { 11,   "CLOCK_TAI"},
+       { CLOCK_REALTIME,               "CLOCK_REALTIME"},
+       { CLOCK_MONOTONIC,              "CLOCK_MONOTONIC"},
+       { CLOCK_PROCESS_CPUTIME_ID,     "CLOCK_PROCESS_CPUTIME_ID"},
+       { CLOCK_THREAD_CPUTIME_ID,      "CLOCK_THREAD_CPUTIME_ID"},
+       { CLOCK_MONOTONIC_RAW,          "CLOCK_MONOTONIC_RAW"},
+       { CLOCK_REALTIME_COARSE,        "CLOCK_REALTIME_COARSE"},
+       { CLOCK_MONOTONIC_COARSE,       "CLOCK_MONOTONIC_COARSE"},
+       { CLOCK_BOOTTIME,               "CLOCK_BOOTTIME"},
+       { CLOCK_REALTIME_ALARM,         "CLOCK_REALTIME_ALARM"},
+       { CLOCK_BOOTTIME_ALARM,         "CLOCK_BOOTTIME_ALARM"},
+       { 10,                           "CLOCK_SGI_CYCLE"},
+       { CLOCK_TAI,                    "CLOCK_TAI"},
 };
 
 static void test_one_clock_gettime(int clock, const char *name)

-- 
2.55.0


Reply via email to