Re: [PATCH] cgroup: remove unnecessary unlikely()

2018-11-05 Thread Tejun Heo
On Sat, Nov 03, 2018 at 10:27:41PM -0400, Yangtao Li wrote:
> WARN_ON() already contains an unlikely(), so it's not necessary to use
> unlikely.
> 
> Signed-off-by: Yangtao Li 

Applied to cgroup/for-4.21.

Thanks.

-- 
tejun


Re: [PATCH] cgroup: remove unnecessary unlikely()

2018-11-05 Thread Tejun Heo
On Sat, Nov 03, 2018 at 10:27:41PM -0400, Yangtao Li wrote:
> WARN_ON() already contains an unlikely(), so it's not necessary to use
> unlikely.
> 
> Signed-off-by: Yangtao Li 

Applied to cgroup/for-4.21.

Thanks.

-- 
tejun


[PATCH] cgroup: remove unnecessary unlikely()

2018-11-03 Thread Yangtao Li
WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.

Signed-off-by: Yangtao Li 
---
 kernel/cgroup/cgroup.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 6aaf5dd5383b..2e5d90dfcb49 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5978,10 +5978,8 @@ static ssize_t show_delegatable_files(struct cftype 
*files, char *buf,
 
ret += snprintf(buf + ret, size - ret, "%s\n", cft->name);
 
-   if (unlikely(ret >= size)) {
-   WARN_ON(1);
+   if (WARN_ON(ret >= size))
break;
-   }
}
 
return ret;
-- 
2.17.0



[PATCH] cgroup: remove unnecessary unlikely()

2018-11-03 Thread Yangtao Li
WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.

Signed-off-by: Yangtao Li 
---
 kernel/cgroup/cgroup.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 6aaf5dd5383b..2e5d90dfcb49 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5978,10 +5978,8 @@ static ssize_t show_delegatable_files(struct cftype 
*files, char *buf,
 
ret += snprintf(buf + ret, size - ret, "%s\n", cft->name);
 
-   if (unlikely(ret >= size)) {
-   WARN_ON(1);
+   if (WARN_ON(ret >= size))
break;
-   }
}
 
return ret;
-- 
2.17.0