Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1322673 > unrolled thread

[PATCH] init/main.c: use list_for_each_entry()

Started byGeliang Tang <geliangtang@163.com>
First post2016-01-31 17:10 +0100
Last post2016-01-31 17:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] init/main.c: use list_for_each_entry() Geliang Tang <geliangtang@163.com> - 2016-01-31 17:10 +0100

#1322673 — [PATCH] init/main.c: use list_for_each_entry()

FromGeliang Tang <geliangtang@163.com>
Date2016-01-31 17:10 +0100
Subject[PATCH] init/main.c: use list_for_each_entry()
Message-ID<qX2Jz-5Lg-5@gated-at.bofh.it>
Use list_for_each_entry() instead of list_for_each() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 init/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/init/main.c b/init/main.c
index 68ec07b..3cf30ec 100644
--- a/init/main.c
+++ b/init/main.c
@@ -728,7 +728,6 @@ static int __init initcall_blacklist(char *str)
 
 static bool __init_or_module initcall_blacklisted(initcall_t fn)
 {
-	struct list_head *tmp;
 	struct blacklist_entry *entry;
 	char *fn_name;
 
@@ -736,8 +735,7 @@ static bool __init_or_module initcall_blacklisted(initcall_t fn)
 	if (!fn_name)
 		return false;
 
-	list_for_each(tmp, &blacklisted_initcalls) {
-		entry = list_entry(tmp, struct blacklist_entry, next);
+	list_for_each_entry(entry, &blacklisted_initcalls, next) {
 		if (!strcmp(fn_name, entry->buf)) {
 			pr_debug("initcall %s blacklisted\n", fn_name);
 			kfree(fn_name);
-- 
2.5.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web