From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755686AbcBHTJS (ORCPT ); Mon, 8 Feb 2016 14:09:18 -0500 Received: from prod-mail-xrelay05.akamai.com ([23.79.238.179]:21723 "EHLO prod-mail-xrelay05.akamai.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753249AbcBHTJQ (ORCPT ); Mon, 8 Feb 2016 14:09:16 -0500 Subject: Re: [PATCH] locking/static_keys: avoid nested functions To: Arnd Bergmann , Ingo Molnar References: <1454942223-2781480-1-git-send-email-arnd@arndb.de> Cc: linux-arm-kernel@lists.infradead.org, "Peter Zijlstra (Intel)" , linux-kernel@vger.kernel.org From: Jason Baron Message-ID: <56B8E7D9.1080301@akamai.com> Date: Mon, 8 Feb 2016 14:09:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454942223-2781480-1-git-send-email-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/08/2016 09:36 AM, Arnd Bergmann wrote: > clang does not support nested functions inside of an array definition: > > lib/test_static_keys.c:105:16: error: function definition is not allowed here > .test_key = test_key_func(&old_true_key, static_key_true), > lib/test_static_keys.c:50:20: note: expanded from macro 'test_key_func' > ({bool func(void) { return branch(key); } func; }) > > That code appears to have been a little too clever, so this > simplifies it a bit by defining functions outside of the array. > > Signed-off-by: Arnd Bergmann > --- > lib/test_static_keys.c | 62 ++++++++++++++++++++++++++++++++++---------------- > 1 file changed, 42 insertions(+), 20 deletions(-) > Works for me. Acked-by: Jason Baron Thanks, -Jason