From: Kamalesh Babulal Date: Tue, 8 Aug 2023 10:15:56 +0000 (+0530) Subject: src/abstraction-map.c: use ARRAY_SIZE() macro X-Git-Tag: v3.2.0~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbcfcaed7ae39ba48e9423d8e37a0cd0f50aa5fb;p=thirdparty%2Flibcgroup.git src/abstraction-map.c: 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/src/abstraction-map.c b/src/abstraction-map.c index 1735e364..3e63b9d5 100644 --- a/src/abstraction-map.c +++ b/src/abstraction-map.c @@ -42,7 +42,7 @@ const struct cgroup_abstraction_map cgroup_v1_to_v2_map[] = { {cgroup_convert_unmappable, "cpuset.sched_load_balance", NULL, NULL, NULL}, {cgroup_convert_unmappable, "cpuset.sched_relax_domain_level", NULL, NULL, NULL}, }; -const int cgroup_v1_to_v2_map_sz = sizeof(cgroup_v1_to_v2_map) / sizeof(cgroup_v1_to_v2_map[0]); +const int cgroup_v1_to_v2_map_sz = ARRAY_SIZE(cgroup_v1_to_v2_map); const struct cgroup_abstraction_map cgroup_v2_to_v1_map[] = { /* cpu controller */ @@ -59,4 +59,4 @@ const struct cgroup_abstraction_map cgroup_v2_to_v1_map[] = { {cgroup_convert_cpuset_to_exclusive, "cpuset.cpus.partition", NULL, "cpuset.cpu_exclusive", NULL}, }; -const int cgroup_v2_to_v1_map_sz = sizeof(cgroup_v2_to_v1_map) / sizeof(cgroup_v2_to_v1_map[0]); +const int cgroup_v2_to_v1_map_sz = ARRAY_SIZE(cgroup_v2_to_v1_map);