All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroup: remove unnecessary unlikely()
@ 2018-11-04  2:27 Yangtao Li
  2018-11-05 16:31 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li @ 2018-11-04  2:27 UTC (permalink / raw)
  To: tj, guro, axboe, dennis, hannes, dennisszhou; +Cc: linux-kernel, Yangtao Li

WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 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


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

* Re: [PATCH] cgroup: remove unnecessary unlikely()
  2018-11-04  2:27 [PATCH] cgroup: remove unnecessary unlikely() Yangtao Li
@ 2018-11-05 16:31 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2018-11-05 16:31 UTC (permalink / raw)
  To: Yangtao Li; +Cc: guro, axboe, dennis, hannes, dennisszhou, linux-kernel

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 <tiny.windzz@gmail.com>

Applied to cgroup/for-4.21.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2018-11-05 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-04  2:27 [PATCH] cgroup: remove unnecessary unlikely() Yangtao Li
2018-11-05 16:31 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.