From: Jiri Kosina Date: Wed, 8 Mar 2017 13:27:05 +0000 (+0100) Subject: livepatch: make klp_mutex proper part of API X-Git-Tag: Ubuntu-4.12.0-11.12~1221^2^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=10517429b5ac242498d7d847f79f10c21d7eedb0;hp=3ec24776bfd09668079df7dca0c0136d80820ab4;p=mirror_ubuntu-artful-kernel.git livepatch: make klp_mutex proper part of API klp_mutex is shared between core.c and transition.c, and as such would rather be properly located in a header so that we don't have to play 'extern' games from .c sources. This also silences sparse warning (wrongly) suggesting that klp_mutex should be defined static. Acked-by: Miroslav Benes Acked-by: Josh Poimboeuf Signed-off-by: Jiri Kosina --- diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 6844c1213df8..47402b8b3990 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -31,6 +31,7 @@ #include #include #include +#include "core.h" #include "patch.h" #include "transition.h" diff --git a/kernel/livepatch/core.h b/kernel/livepatch/core.h new file mode 100644 index 000000000000..c74f24c47837 --- /dev/null +++ b/kernel/livepatch/core.h @@ -0,0 +1,6 @@ +#ifndef _LIVEPATCH_CORE_H +#define _LIVEPATCH_CORE_H + +extern struct mutex klp_mutex; + +#endif /* _LIVEPATCH_CORE_H */ diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 0ab7abd53b0b..2de09e0c4e5c 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -21,6 +21,7 @@ #include #include +#include "core.h" #include "patch.h" #include "transition.h" #include "../sched/sched.h" @@ -28,8 +29,6 @@ #define MAX_STACK_ENTRIES 100 #define STACK_ERR_BUF_SIZE 128 -extern struct mutex klp_mutex; - struct klp_patch *klp_transition_patch; static int klp_target_state = KLP_UNDEFINED;