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

From: Peter Zijlstra
Date: Wed Jul 29 2015 - 04:54:16 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/