2022-09-17 09:01:21

by williamsukatube

[permalink] [raw]
Subject: [PATCH -next] cgroup: simplify code in cgroup_apply_control

From: William Dean <[email protected]>

It could directly return 'cgroup_update_dfl_csses' to simplify code.

Signed-off-by: William Dean <[email protected]>
---
kernel/cgroup/cgroup.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index e4bb5d57f4d1..1958f8bd93d6 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3292,11 +3292,7 @@ static int cgroup_apply_control(struct cgroup *cgrp)
* making the following cgroup_update_dfl_csses() properly update
* css associations of all tasks in the subtree.
*/
- ret = cgroup_update_dfl_csses(cgrp);
- if (ret)
- return ret;
-
- return 0;
+ return cgroup_update_dfl_csses(cgrp);
}

/**
--
2.25.1


2022-09-19 11:26:48

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH -next] cgroup: simplify code in cgroup_apply_control

Hi,

On 9/17/2022 2:10 PM, [email protected] wrote:
> From: William Dean <[email protected]>
>
> It could directly return 'cgroup_update_dfl_csses' to simplify code.
>
> Signed-off-by: William Dean <[email protected]>
> ---
> kernel/cgroup/cgroup.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index e4bb5d57f4d1..1958f8bd93d6 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -3292,11 +3292,7 @@ static int cgroup_apply_control(struct cgroup *cgrp)
> * making the following cgroup_update_dfl_csses() properly update
> * css associations of all tasks in the subtree.
> */
> - ret = cgroup_update_dfl_csses(cgrp);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return cgroup_update_dfl_csses(cgrp);
> }
>
> /**
> --
> 2.25.1
>

LGTM.

Reviewed-by: Mukesh Ojha <[email protected]>

-Mukesh

2022-09-24 03:32:48

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH -next] cgroup: simplify code in cgroup_apply_control

On Sat, Sep 17, 2022 at 04:40:39PM +0800, [email protected] wrote:
> From: William Dean <[email protected]>
>
> It could directly return 'cgroup_update_dfl_csses' to simplify code.
>
> Signed-off-by: William Dean <[email protected]>

Applied to cgroup/for-6.1.

Thanks.

--
tejun