mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Jason Baron <jbaron@akamai.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: static key arrays?
Date: Fri, 11 Sep 2015 16:41:26 +0200	[thread overview]
Message-ID: <87zj0taui1.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <1441973699.2083.6.camel@sipsolutions.net> (Johannes Berg's message of "Fri, 11 Sep 2015 14:14:59 +0200")

On Fri, Sep 11 2015, Johannes Berg <johannes@sipsolutions.net> wrote:

> On Fri, 2015-09-11 at 13:10 +0200, Peter Zijlstra wrote:
>> 
>> struct static_key_false array[n] = { STATIC_KEY_FALSE_INIT, };
>> 
>> or something like that.
>
> Yeah, ok, this would be sufficient for me - no need to mix different
> types. I don't think that initializer works, but I guess we can just
> duplicate it in the code 

That's inconvenient for large arrays. I think the 'or something' would
be the range initialization supported by gcc (and I think also clang):

struct static_key_false array[N] = { [0 ... N-1] = STATIC_KEY_FALSE_INIT };

Rasmus

  reply	other threads:[~2015-09-11 14:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11  9:45 Johannes Berg
2015-09-11 11:10 ` Peter Zijlstra
2015-09-11 12:14   ` Johannes Berg
2015-09-11 14:41     ` Rasmus Villemoes [this message]
2015-09-11 14:55       ` Johannes Berg
2015-09-11 11:17 ` Baron, Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj0taui1.fsf@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=jbaron@akamai.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®