From: Kamalesh Babulal Date: Tue, 8 Aug 2023 10:56:58 +0000 (+0530) Subject: gunit/015: use ARRAY_SIZE() macro X-Git-Tag: v3.2.0~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3634d0025e1143b503818f0974f08360421f70be;p=thirdparty%2Flibcgroup.git 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 --- 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,