From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521AbdCHN24 (ORCPT ); Wed, 8 Mar 2017 08:28:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:55963 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753234AbdCHN1W (ORCPT ); Wed, 8 Mar 2017 08:27:22 -0500 Date: Wed, 8 Mar 2017 14:27:05 +0100 (CET) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: Josh Poimboeuf , Jessica Yu , Miroslav Benes , Petr Mladek cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] livepatch: make klp_mutex proper part of API In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Kosina 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. Signed-off-by: Jiri Kosina --- kernel/livepatch/core.c | 1 + kernel/livepatch/core.h | 6 ++++++ kernel/livepatch/transition.c | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 kernel/livepatch/core.h 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; -- Jiri Kosina SUSE Labs