[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830802271649h29a13ceevf2255dd6235b42ba@mail.gmail.com>
Date: Wed, 27 Feb 2008 16:49:44 -0800
From: "Paul Menage" <menage@...gle.com>
To: "Paul Jackson" <pj@....com>
Cc: "Li Zefan" <lizf@...fujitsu.com>, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpuset: fix return value of cpuset_populate()
On Tue, Feb 26, 2008 at 11:41 PM, Paul Jackson <pj@....com> wrote:
>
> - no need to check err == 0
> - the last return value of cgroup_add_file() is ignored
>
> Signed-off-by: Li Zefan <lizf@...fujitsu.com>
Looks fine from a cleanliness PoV, although since we don't actually do
anything with an error result from subsys->populate() (a behaviour
that I sort of inherited from cpusets ...) it won't make a whole lot
of difference to the code.
A better change would be to make cpuset_populate() use cgroup_add_files().
Paul
> ---
> kernel/cpuset.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 3e296ed..1c5b2d2 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -1482,10 +1482,10 @@ static int cpuset_populate(struct cgroup_subsys *ss, struct cgroup *cont)
> if ((err = cgroup_add_file(cont, ss, &cft_spread_slab)) < 0)
> return err;
> /* memory_pressure_enabled is in root cpuset only */
> - if (err == 0 && !cont->parent)
> + if (!cont->parent)
> err = cgroup_add_file(cont, ss,
> &cft_memory_pressure_enabled);
> - return 0;
> + return err;
> }
>
> /*
> --
> 1.5.4.rc3
>
>
> --
> I won't rest till it's the best ...
> Programmer, Linux Scalability
> Paul Jackson <pj@....com> 1.940.382.4214
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists