lkml.org 
[lkml]   [2024]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next] cgroup: Introduce css_is_online() helper
On Sat 20-04-24 09:44:28, Xiu Jianfeng wrote:
> Introduce css_is_online() helper to test if whether the specified
> css is online, avoid testing css.flags with CSS_ONLINE directly
> outside of cgroup.c.
>
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

One style nit below:

> +/*
> + * css_is_online - test whether the specified css is online
> + * @css: target css
> + */
> +static inline bool css_is_online(struct cgroup_subsys_state *css)
> +{
> + return !!(css->flags & CSS_ONLINE);
> +}

Since the return type is 'bool', you don't need the !! magic in the
statement above.

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2024-05-27 17:58    [W:1.178 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site