From 3634d0025e1143b503818f0974f08360421f70be Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Tue, 8 Aug 2023 16:26:58 +0530 Subject: [PATCH] gunit/015: use ARRAY_SIZE() macro Use ARRAY_SIZE() macro to calculate the length of the array, across the file. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- tests/gunit/015-cgroupv2_controller_enabled.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/gunit/015-cgroupv2_controller_enabled.cpp b/tests/gunit/015-cgroupv2_controller_enabled.cpp index f5ad47c2..85db6fee 100644 --- a/tests/gunit/015-cgroupv2_controller_enabled.cpp +++ b/tests/gunit/015-cgroupv2_controller_enabled.cpp @@ -23,8 +23,7 @@ static const char * const CHILD_DIRS[] = { "test3-ctrlrenabled", "test4-ctrlrdisabled", }; -static const int CHILD_DIRS_CNT = - sizeof(CHILD_DIRS) / sizeof(CHILD_DIRS[0]); +static const int CHILD_DIRS_CNT = ARRAY_SIZE(CHILD_DIRS); static const char * const CONTROLLERS[] = { "cpu", @@ -34,8 +33,7 @@ static const char * const CONTROLLERS[] = { "net_cls", "pids", }; -static const int CONTROLLERS_CNT = - sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]); +static const int CONTROLLERS_CNT = ARRAY_SIZE(CONTROLLERS); static const enum cg_version_t VERSIONS[] = { CGROUP_V2, -- 2.47.2