Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1210917
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros |
| Date | 2015-08-21 08:30 +0200 |
| Message-ID | <pZNZX-3SZ-87@gated-at.bofh.it> (permalink) |
| References | <pZwZ4-4Ab-17@gated-at.bofh.it> <pZwZ6-4Ab-53@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* Kevin Hao <haokexin@gmail.com> wrote:
> These are used to define a static_key_{true,false} array.
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
> include/linux/jump_label.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
> index 7f653e8f6690..5c1d6a49dd6b 100644
> --- a/include/linux/jump_label.h
> +++ b/include/linux/jump_label.h
> @@ -267,6 +267,12 @@ struct static_key_false {
> #define DEFINE_STATIC_KEY_FALSE(name) \
> struct static_key_false name = STATIC_KEY_FALSE_INIT
>
> +#define DEFINE_STATIC_KEY_TRUE_ARRAY(name, n) \
> + struct static_key_true name[n] = { [0 ... n - 1] = STATIC_KEY_TRUE_INIT }
> +
> +#define DEFINE_STATIC_KEY_FALSE_ARRAY(name, n) \
> + struct static_key_false name[n] = { [0 ... n - 1] = STATIC_KEY_FALSE_INIT }
I think the define makes the code more obfuscated and less clear, the open-coded
initialization is pretty dense and easy to read to begin with.
Thanks,
Ingo
--
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 | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/8] powerpc: use jump label for {cpu,mmu}_has_feature() Kevin Hao <haokexin@gmail.com> - 2015-08-20 14:20 +0200
[PATCH 8/8] powerpc: use jump label for mmu_has_feature Kevin Hao <haokexin@gmail.com> - 2015-08-20 14:20 +0200
[PATCH 7/8] powerpc: use the jump label for cpu_has_feature Kevin Hao <haokexin@gmail.com> - 2015-08-20 14:20 +0200
[PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros Kevin Hao <haokexin@gmail.com> - 2015-08-20 14:20 +0200
Re: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros Peter Zijlstra <peterz@infradead.org> - 2015-08-20 20:40 +0200
Re: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros Kevin Hao <haokexin@gmail.com> - 2015-08-21 05:30 +0200
Re: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros Ingo Molnar <mingo@kernel.org> - 2015-08-21 08:30 +0200
Re: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros Kevin Hao <haokexin@gmail.com> - 2015-08-21 08:40 +0200
Re: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros Kevin Hao <haokexin@gmail.com> - 2015-08-21 08:50 +0200
Re: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE,FALSE}_ARRAY macros Ingo Molnar <mingo@kernel.org> - 2015-08-21 08:50 +0200
csiph-web