summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-03-15 14:52:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-15 16:55:16 -0700
commite6fd1fb3b5b58fcfa8e546c69d9cb64aa2c5c9b8 (patch)
treeddf29edade8a5691c395bcb7e8307a94be7e4e63 /init
parente23604edac2a7be6a8808a5d13fac6b9df4eb9a8 (diff)
downloadlinux-e6fd1fb3b5b58fcfa8e546c69d9cb64aa2c5c9b8.tar.gz
linux-e6fd1fb3b5b58fcfa8e546c69d9cb64aa2c5c9b8.tar.bz2
linux-e6fd1fb3b5b58fcfa8e546c69d9cb64aa2c5c9b8.zip
init/main.c: use list_for_each_entry()
Use list_for_each_entry() instead of list_for_each() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/init/main.c b/init/main.c
index 7c27de4577ed..031a60893fdb 100644
--- a/init/main.c
+++ b/init/main.c
@@ -719,7 +719,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;
@@ -727,8 +726,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);