livepatch: Introduce klp_for_each_patch macro

There are already macros to iterate over struct klp_func and klp_object.

Add also klp_for_each_patch(). But make it internal because also
klp_patches list is internal.

Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
This commit is contained in:
Petr Mladek
2019-02-04 14:56:50 +01:00
parent 375bfca345
commit ecba29f434
3 changed files with 11 additions and 5 deletions

View File

@@ -642,6 +642,6 @@ void klp_force_transition(void)
for_each_possible_cpu(cpu)
klp_update_patch_state(idle_task(cpu));
list_for_each_entry(patch, &klp_patches, list)
klp_for_each_patch(patch)
patch->forced = true;
}