linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cgroup: Remove unnecessary call to strstrip()
@ 2021-01-03  2:50 Hao Lee
  2021-01-14 12:44 ` Michal Koutný
  0 siblings, 1 reply; 7+ messages in thread
From: Hao Lee @ 2021-01-03  2:50 UTC (permalink / raw)
  To: tj; +Cc: lizefan, hannes, cgroups, linux-kernel, haolee.swjtu

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

Signed-off-by: Hao Lee <haolee.swjtu@gmail.com>
---
 kernel/cgroup/cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 5e9cb81c088a..8b3554c1113a 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -4774,8 +4774,6 @@ static ssize_t cgroup_threads_write(struct kernfs_open_file *of,
 	ssize_t ret;
 	bool locked;
 
-	buf = strstrip(buf);
-
 	dst_cgrp = cgroup_kn_lock_live(of->kn, false);
 	if (!dst_cgrp)
 		return -ENODEV;
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] cgroup: Remove unnecessary call to strstrip()
@ 2020-09-08 13:33 Hao Lee
  2020-10-01 14:46 ` Hao Lee
  0 siblings, 1 reply; 7+ messages in thread
From: Hao Lee @ 2020-09-08 13:33 UTC (permalink / raw)
  To: tj; +Cc: lizefan, hannes, cgroups, linux-kernel, haolee.swjtu

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

Signed-off-by: Hao Lee <haolee.swjtu@gmail.com>
---
 kernel/cgroup/cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index b6714166106d..90ee7e73eb2e 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -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);
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-15 20:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03  2:50 [PATCH] cgroup: Remove unnecessary call to strstrip() Hao Lee
2021-01-14 12:44 ` Michal Koutný
2021-01-14 17:35   ` Daniel Jordan
2021-01-15  2:19   ` Hao Lee
2021-01-15 20:31   ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2020-09-08 13:33 Hao Lee
2020-10-01 14:46 ` Hao Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).