From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752925AbbIKOla (ORCPT ); Fri, 11 Sep 2015 10:41:30 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:37242 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752777AbbIKOl2 (ORCPT ); Fri, 11 Sep 2015 10:41:28 -0400 From: Rasmus Villemoes To: Johannes Berg Cc: Peter Zijlstra , Jason Baron , linux-kernel Subject: Re: static key arrays? Organization: D03 References: <1441964735.2083.4.camel@sipsolutions.net> <20150911111003.GK18489@twins.programming.kicks-ass.net> <1441973699.2083.6.camel@sipsolutions.net> X-Hashcash: 1:20:150911:linux-kernel@vger.kernel.org::ydf1aMn+qgBh03iw:0000000000000000000000000000000000brQ X-Hashcash: 1:20:150911:jbaron@akamai.com::0LPVW/BzkljNXbzz:000000000000000000000000000000000000000000000x1B X-Hashcash: 1:20:150911:peterz@infradead.org::5GMhB2VVzQtw53yD:000000000000000000000000000000000000000003+jz X-Hashcash: 1:20:150911:johannes@sipsolutions.net::p+H7FbGj6pILKY8d:0000000000000000000000000000000000004ojy Date: Fri, 11 Sep 2015 16:41:26 +0200 In-Reply-To: <1441973699.2083.6.camel@sipsolutions.net> (Johannes Berg's message of "Fri, 11 Sep 2015 14:14:59 +0200") Message-ID: <87zj0taui1.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 11 2015, Johannes Berg 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