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>
This commit is contained in:
parent
e23604edac
commit
e6fd1fb3b5
@ -719,7 +719,6 @@ static int __init initcall_blacklist(char *str)
|
|||||||
|
|
||||||
static bool __init_or_module initcall_blacklisted(initcall_t fn)
|
static bool __init_or_module initcall_blacklisted(initcall_t fn)
|
||||||
{
|
{
|
||||||
struct list_head *tmp;
|
|
||||||
struct blacklist_entry *entry;
|
struct blacklist_entry *entry;
|
||||||
char *fn_name;
|
char *fn_name;
|
||||||
|
|
||||||
@ -727,8 +726,7 @@ static bool __init_or_module initcall_blacklisted(initcall_t fn)
|
|||||||
if (!fn_name)
|
if (!fn_name)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
list_for_each(tmp, &blacklisted_initcalls) {
|
list_for_each_entry(entry, &blacklisted_initcalls, next) {
|
||||||
entry = list_entry(tmp, struct blacklist_entry, next);
|
|
||||||
if (!strcmp(fn_name, entry->buf)) {
|
if (!strcmp(fn_name, entry->buf)) {
|
||||||
pr_debug("initcall %s blacklisted\n", fn_name);
|
pr_debug("initcall %s blacklisted\n", fn_name);
|
||||||
kfree(fn_name);
|
kfree(fn_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user