From 2cea199ec124b965af6ea7a0c426c7f768f2120e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 11 Oct 2019 11:43:32 +0200 Subject: [PATCH] core: pass around pointer, not struct Since this is a static function, the compiler is likely to optimize it away anyway, but let's do the normal thing here. --- src/core/cgroup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index c67ecc3..981aca5 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -970,10 +970,10 @@ static uint64_t cgroup_cpu_weight_to_shares(uint64_t weight) { CGROUP_CPU_SHARES_MIN, CGROUP_CPU_SHARES_MAX); } -static void cgroup_apply_unified_cpuset(Unit *u, CPUSet cpus, const char *name) { +static void cgroup_apply_unified_cpuset(Unit *u, const CPUSet *cpus, const char *name) { _cleanup_free_ char *buf = NULL; - buf = cpu_set_to_range_string(&cpus); + buf = cpu_set_to_range_string(cpus); if (!buf) return; @@ -1221,8 +1221,8 @@ static void cgroup_context_apply( } if ((apply_mask & CGROUP_MASK_CPUSET) && !is_local_root) { - cgroup_apply_unified_cpuset(u, c->cpuset_cpus, "cpuset.cpus"); - cgroup_apply_unified_cpuset(u, c->cpuset_mems, "cpuset.mems"); + cgroup_apply_unified_cpuset(u, &c->cpuset_cpus, "cpuset.cpus"); + cgroup_apply_unified_cpuset(u, &c->cpuset_mems, "cpuset.mems"); } /* The 'io' controller attributes are not exported on the host's root cgroup (being a pure cgroup v2 -- 2.7.4