Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1595115

Re: [PATCH] livepatch: make klp_mutex proper part of API

From Miroslav Benes <mbenes@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH] livepatch: make klp_mutex proper part of API
Date 2017-03-08 13:30 +0100
Message-ID <tiIT8-6v2-27@gated-at.bofh.it> (permalink)
References <tiGxY-4My-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 8 Mar 2017, Jiri Kosina wrote:

> From: Jiri Kosina <jkosina@suse.cz>
> 
> 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 <jkosina@suse.cz>
> ---
>  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;
> -

A nit, but could you also include "linux/livepatch.h" in transition.c to 
make the dependency explicit (and not through patch.h or transition.h)?

Anyway, not a big deal and you can add my

Acked-by: Miroslav Benes <mbenes@suse.cz>

Miroslav

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] livepatch: make klp_mutex proper part of API Jiri Kosina <jikos@kernel.org> - 2017-03-08 11:00 +0100
  Re: [PATCH] livepatch: make klp_mutex proper part of API Miroslav Benes <mbenes@suse.cz> - 2017-03-08 13:30 +0100
  Re: [PATCH] livepatch: make klp_mutex proper part of API Miroslav Benes <mbenes@suse.cz> - 2017-03-08 14:20 +0100
  [PATCH v2] livepatch: make klp_mutex proper part of API Jiri Kosina <jikos@kernel.org> - 2017-03-08 14:30 +0100
    Re: [PATCH v2] livepatch: make klp_mutex proper part of API Miroslav Benes <mbenes@suse.cz> - 2017-03-08 14:40 +0100
    Re: [PATCH v2] livepatch: make klp_mutex proper part of API Josh Poimboeuf <jpoimboe@redhat.com> - 2017-03-08 14:40 +0100
  Re: [PATCH] livepatch: make klp_mutex proper part of API Josh Poimboeuf <jpoimboe@redhat.com> - 2017-03-08 18:30 +0100

csiph-web