From patchwork Thu Aug 20 12:14:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 509031 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 153E514028E for ; Thu, 20 Aug 2015 22:21:25 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=W/SOTAx0; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id CD5B61A1D78 for ; Thu, 20 Aug 2015 22:21:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=W/SOTAx0; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-yk0-x22c.google.com (mail-yk0-x22c.google.com [IPv6:2607:f8b0:4002:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 237EB1A1D75 for ; Thu, 20 Aug 2015 22:15:05 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=W/SOTAx0; dkim-atps=neutral Received: by ykll84 with SMTP id l84so35024141ykl.0 for ; Thu, 20 Aug 2015 05:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NjCz5XLW8ZXlRD0P9iAehlwOhEC0ja/bRWOXY2Vp38I=; b=W/SOTAx0P0fbvtzqtDfR8Gwhrv5dNwmOk3gBs8u00Rh9uN/D/QNOUFlbBlyEJrSTzz BeiBKDZ8TEIagyQsm7/3+8ZodFRqVuVdsauWA5xQMsxJ4+YVZhOKdy61v7Uq93uNVIw5 S9HpIZgJLTu75Dei9sKxdAxb29HH16jJIlWYX8SCLCyw++5Xv9nDluNHdyQNatG4bkb0 iS1kds1t95pfvHJ6UDk4uBT5+AN/mAcwkMWqqN7HjyziO3LUt2UlzqOk9tUYgd0y5tdv psrYsFS1o7MNjAUvHQQL9WQW0yy4fRULhoJ2jcgTCxgCJ11KPD4llmwpghn/lriWqlqo GVPA== X-Received: by 10.129.39.203 with SMTP id n194mr2870748ywn.34.1440072903178; Thu, 20 Aug 2015 05:15:03 -0700 (PDT) Received: from pek-khao-d1.corp.ad.wrs.com (unknown-178-22.windriver.com. [147.11.178.22]) by smtp.gmail.com with ESMTPSA id w62sm3745368ywe.50.2015.08.20.05.14.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2015 05:15:02 -0700 (PDT) From: Kevin Hao To: Michael Ellerman Subject: [PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE, FALSE}_ARRAY macros Date: Thu, 20 Aug 2015 20:14:31 +0800 Message-Id: <1440072876-8321-4-git-send-email-haokexin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1440072876-8321-1-git-send-email-haokexin@gmail.com> References: <1440072876-8321-1-git-send-email-haokexin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ingo Molnar MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" These are used to define a static_key_{true,false} array. Signed-off-by: Kevin Hao --- 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 } + #ifdef HAVE_JUMP_LABEL /*