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


Groups > linux.kernel > #1194963

Re: [PATCH -v2 7/8] jump_label: Add selftest

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH -v2 7/8] jump_label: Add selftest
Date 2015-07-29 11:00 +0200
Message-ID <pRvns-3cL-21@gated-at.bofh.it> (permalink)
References <pRd7c-27d-3@gated-at.bofh.it> <pRd7b-27d-1@gated-at.bofh.it> <pRl4K-51M-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jul 28, 2015 at 05:46:40PM -0400, Jason Baron wrote:
> On 07/28/2015 09:21 AM, Peter Zijlstra wrote:

> In order to get the !CONFIG_JUMP_LABEL to work I needed,
> the following:
> 
> diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
> index c033595..27b335a 100644
> --- a/include/linux/jump_label.h
> +++ b/include/linux/jump_label.h
> @@ -183,10 +183,10 @@ static inline int jump_label_apply_nops(struct module *mod)
>      return 0;
>  }
>  
> -#define STATIC_KEY_INIT_TRUE ((struct static_key) \
> -        { .enabled = ATOMIC_INIT(1) })
> -#define STATIC_KEY_INIT_FALSE ((struct static_key) \
> -        { .enabled = ATOMIC_INIT(0) })
> +#define STATIC_KEY_INIT_TRUE    \
> +        { .enabled = ATOMIC_INIT(1) }
> +#define STATIC_KEY_INIT_FALSE    \
> +        { .enabled = ATOMIC_INIT(0) }
>  
>  #endif    /* HAVE_JUMP_LABEL */
>  

Right, I still need to figure out why GCC thinks its not a constant
with that typecast present.

Thanks.

> Other than that, everything seems to be working fine for me
> with -v2.
> 
> We probably should also update Documentation/static-keys.txt.
> I can take a stab at that, if needed.

Ah, yes please. Also the blob at the top of jump_label.h needs some TLC.

> Module selftest is below.
> 

You put a _lot_ more effort in it than me, and it does indeed cover
more, so sure we can do that.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [PATCH -v2 7/8] jump_label: Add selftest Jason Baron <jbaron@akamai.com> - 2015-07-29 00:00 +0200
  Re: [PATCH -v2 7/8] jump_label: Add selftest Peter Zijlstra <peterz@infradead.org> - 2015-07-29 11:00 +0200

csiph-web