Skip to content

Commit

Permalink
livepatch: make klp_mutex proper part of API
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
Jiri Kosina committed Mar 8, 2017
1 parent 3ec2477 commit 1051742
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions kernel/livepatch/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 6 additions & 0 deletions kernel/livepatch/core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _LIVEPATCH_CORE_H
#define _LIVEPATCH_CORE_H

extern struct mutex klp_mutex;

#endif /* _LIVEPATCH_CORE_H */
3 changes: 1 addition & 2 deletions kernel/livepatch/transition.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@

#include <linux/cpu.h>
#include <linux/stacktrace.h>
#include "core.h"
#include "patch.h"
#include "transition.h"
#include "../sched/sched.h"

#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;
Expand Down

0 comments on commit 1051742

Please sign in to comment.