From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbbIKOzS (ORCPT ); Fri, 11 Sep 2015 10:55:18 -0400 Received: from s3.sipsolutions.net ([5.9.151.49]:36947 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875AbbIKOzQ (ORCPT ); Fri, 11 Sep 2015 10:55:16 -0400 Message-ID: <1441983308.2083.13.camel@sipsolutions.net> Subject: Re: static key arrays? From: Johannes Berg To: Rasmus Villemoes Cc: Peter Zijlstra , Jason Baron , linux-kernel Date: Fri, 11 Sep 2015 16:55:08 +0200 In-Reply-To: <87zj0taui1.fsf@rasmusvillemoes.dk> (sfid-20150911_164128_138967_59961D8F) References: <1441964735.2083.4.camel@sipsolutions.net> <20150911111003.GK18489@twins.programming.kicks-ass.net> <1441973699.2083.6.camel@sipsolutions.net> <87zj0taui1.fsf@rasmusvillemoes.dk> (sfid-20150911_164128_138967_59961D8F) Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-09-11 at 16:41 +0200, Rasmus Villemoes wrote: > > 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 }; > Ah, I wasn't aware of that extension. That's indeed much more convenient than the CPP trick I was thinking of :) johannes