]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
gunit/008: use ARRAY_SIZE() macro
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 8 Aug 2023 10:56:45 +0000 (16:26 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 10 Aug 2023 15:56:48 +0000 (09:56 -0600)
Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/gunit/008-cgroup_process_v2_mount.cpp

index a68c8ed72d190ae879a36cfc45f844a1c819fd6a..f69fd35dcfd269191843fd513fb6fcc0688f1e3e 100644 (file)
@@ -24,8 +24,7 @@ static const char * const CONTROLLERS[] = {
        "pids",
        "rdma",
 };
-static const int CONTROLLERS_CNT =
-       sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]);
+static const int CONTROLLERS_CNT = ARRAY_SIZE(CONTROLLERS);
 
 static int mnt_tbl_idx = 0;