]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: pass around pointer, not struct 13760/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 11 Oct 2019 09:43:32 +0000 (11:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 11 Oct 2019 11:46:05 +0000 (13:46 +0200)
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

index c67ecc37c53a08999065fa629f2e1e29ce8e3e02..981aca53cdb416da6f4766021086b7f0d77d1b72 100644 (file)
@@ -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