diff options
author | Petr Mladek <pmladek@suse.com> | 2019-02-04 08:56:50 -0500 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2019-02-06 04:49:30 -0500 |
commit | ecba29f434a8fa333356d54d2491d174c4aab8de (patch) | |
tree | 5b094d13703679b37c690bc6b0db2ad4d324fd00 /kernel/livepatch/core.h | |
parent | 375bfca3459db1c5596c28c56d2ebac26e51c7b3 (diff) |
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>
Diffstat (limited to 'kernel/livepatch/core.h')
-rw-r--r-- | kernel/livepatch/core.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/livepatch/core.h b/kernel/livepatch/core.h index e6200f38701f..ec43a40b853f 100644 --- a/kernel/livepatch/core.h +++ b/kernel/livepatch/core.h | |||
@@ -7,6 +7,12 @@ | |||
7 | extern struct mutex klp_mutex; | 7 | extern struct mutex klp_mutex; |
8 | extern struct list_head klp_patches; | 8 | extern struct list_head klp_patches; |
9 | 9 | ||
10 | #define klp_for_each_patch_safe(patch, tmp_patch) \ | ||
11 | list_for_each_entry_safe(patch, tmp_patch, &klp_patches, list) | ||
12 | |||
13 | #define klp_for_each_patch(patch) \ | ||
14 | list_for_each_entry(patch, &klp_patches, list) | ||
15 | |||
10 | void klp_free_patch_start(struct klp_patch *patch); | 16 | void klp_free_patch_start(struct klp_patch *patch); |
11 | void klp_discard_replaced_patches(struct klp_patch *new_patch); | 17 | void klp_discard_replaced_patches(struct klp_patch *new_patch); |
12 | void klp_discard_nops(struct klp_patch *new_patch); | 18 | void klp_discard_nops(struct klp_patch *new_patch); |