cgroup/pids: Remove superfluous zeroing
authorMichal Koutný <mkoutny@suse.com>
Tue, 16 Apr 2024 14:20:09 +0000 (16:20 +0200)
committerTejun Heo <tj@kernel.org>
Tue, 16 Apr 2024 19:18:36 +0000 (09:18 -1000)
Atomic counters are in kzalloc'd struct. They are zeroed already and
atomic64_t does not need special initialization
(cf kernel/trace/trace_clock.c:trace_counter).

Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/pids.c

index 7695e60bcb4092000f7cb1ed61f6fcd6d5a8c6a0..0e5ec7d59b4d21ab79342a02d9ba1a0ec864d71f 100644 (file)
@@ -75,9 +75,7 @@ pids_css_alloc(struct cgroup_subsys_state *parent)
        if (!pids)
                return ERR_PTR(-ENOMEM);
 
-       atomic64_set(&pids->counter, 0);
        atomic64_set(&pids->limit, PIDS_MAX);
-       atomic64_set(&pids->events_limit, 0);
        return &pids->css;
 }