Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10517429 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

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: default avatarMiroslav Benes <mbenes@suse.cz>
Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 3ec24776
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <linux/moduleloader.h>
#include <linux/completion.h>
#include <asm/cacheflush.h>
#include "core.h"
#include "patch.h"
#include "transition.h"

+6 −0
Original line number Diff line number Diff line
#ifndef _LIVEPATCH_CORE_H
#define _LIVEPATCH_CORE_H

extern struct mutex klp_mutex;

#endif /* _LIVEPATCH_CORE_H */
+1 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

#include <linux/cpu.h>
#include <linux/stacktrace.h>
#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;