Skip to contentSkip to conversation

cgroup: Remove unnecessary call to strstrip()

PATCH In review Hao Lee 1 participant 2 messages Sep 8, 2020 – Oct 1, 2020 cgroup

lore
Share & tools
lore

Hao Lee

author
#0 lore raw

PATCH 1/1 cgroup: Remove unnecessary call to strstrip()

The string buf will be stripped in cgroup_procs_write_start() before it is converted to int, so remove this unnecessary call to strstrip().

---
 kernel/cgroup/cgroup.c | 2 --
 1 file changed, 2 deletions(-)
kernel/cgroup/cgroup.c +0 -2
index b6714166106d..90ee7e73eb2e 100644
@@ -4772,14 +4772,12 @@ static ssize_t cgroup_threads_write(struct kernfs_open_file *of,
 {
 	struct cgroup *src_cgrp, *dst_cgrp;
 	struct task_struct *task;
 	ssize_t ret;
 	bool locked;
 
-	buf = strstrip(buf);
-
 	dst_cgrp = cgroup_kn_lock_live(of->kn, false);
 	if (!dst_cgrp)
 		return -ENODEV;
 
 	task = cgroup_procs_write_start(buf, false, &locked);
 	ret = PTR_ERR_OR_ZERO(task);
Signature · 1 line
2.24.1
author
#1 lore raw

Ping. Thanks.

Quoted 30 lines · Hao Lee

The string buf will be stripped in cgroup_procs_write_start() before it is converted to int, so remove this unnecessary call to strstrip().

---
 kernel/cgroup/cgroup.c | 2 --
 1 file changed, 2 deletions(-)
kernel/cgroup/cgroup.c +0 -2
index b6714166106d..90ee7e73eb2e 100644
@@ -4772,14 +4772,12 @@ static ssize_t cgroup_threads_write(struct kernfs_open_file *of,
 {
 	struct cgroup *src_cgrp, *dst_cgrp;
 	struct task_struct *task;
 	ssize_t ret;
 	bool locked;
 
-	buf = strstrip(buf);
-
 	dst_cgrp = cgroup_kn_lock_live(of->kn, false);
 	if (!dst_cgrp)
 		return -ENODEV;
 
 	task = cgroup_procs_write_start(buf, false, &locked);
 	ret = PTR_ERR_OR_ZERO(task);
Signature · 1 line
2.24.1