Skip to contentSkip to conversation

cgroup: remove unnecessary unlikely()

PATCH Applied Yangtao Li 2 participants 2 messages Nov 4, 2018 – Nov 5, 2018 cgroup

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 cgroup: remove unnecessary unlikely()

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

---
 kernel/cgroup/cgroup.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/cgroup/cgroup.c +1 -3
index 6aaf5dd5383b..2e5d90dfcb49 100644
@@ -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;
Signature · 1 line
2.17.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Yangtao Li

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

Applied to cgroup/for-4.21.

Thanks.

Signature · 1 line
tejun