Skip to content

Commit e6fd1fb

Browse files
geliangtangtorvalds
authored andcommitted
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e23604e commit e6fd1fb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

init/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,16 +719,14 @@ static int __init initcall_blacklist(char *str)
719719

720720
static bool __init_or_module initcall_blacklisted(initcall_t fn)
721721
{
722-
struct list_head *tmp;
723722
struct blacklist_entry *entry;
724723
char *fn_name;
725724

726725
fn_name = kasprintf(GFP_KERNEL, "%pf", fn);
727726
if (!fn_name)
728727
return false;
729728

730-
list_for_each(tmp, &blacklisted_initcalls) {
731-
entry = list_entry(tmp, struct blacklist_entry, next);
729+
list_for_each_entry(entry, &blacklisted_initcalls, next) {
732730
if (!strcmp(fn_name, entry->buf)) {
733731
pr_debug("initcall %s blacklisted\n", fn_name);
734732
kfree(fn_name);

0 commit comments

Comments
 (0)