From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbdCHJy1 (ORCPT ); Wed, 8 Mar 2017 04:54:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:52816 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbdCHJyL (ORCPT ); Wed, 8 Mar 2017 04:54:11 -0500 Date: Wed, 8 Mar 2017 10:16:00 +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] livepatch: make klp_mutex proper part of API Message-ID: 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 livepatch.h 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 --- include/linux/livepatch.h | 2 ++ kernel/livepatch/transition.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index 194991ef9347..4efa89f95dd7 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -138,6 +138,8 @@ struct klp_patch { func->old_name || func->new_func || func->old_sympos; \ func++) +extern struct mutex klp_mutex; + int klp_register_patch(struct klp_patch *); int klp_unregister_patch(struct klp_patch *); int klp_enable_patch(struct klp_patch *); diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 0ab7abd53b0b..14f7ce64b002 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -28,8 +28,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; -- 2.11.0