public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@akamai.com>
To: Arnd Bergmann <arnd@arndb.de>, Ingo Molnar <mingo@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] locking/static_keys: avoid nested functions
Date: Mon, 8 Feb 2016 14:09:13 -0500	[thread overview]
Message-ID: <56B8E7D9.1080301@akamai.com> (raw)
In-Reply-To: <1454942223-2781480-1-git-send-email-arnd@arndb.de>

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 <arnd@arndb.de>
> ---
>  lib/test_static_keys.c | 62 ++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 42 insertions(+), 20 deletions(-)
> 

Works for me.

Acked-by: Jason Baron <jbaron@akamai.com>

Thanks,

-Jason

  reply	other threads:[~2016-02-08 19:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 14:36 [PATCH] locking/static_keys: avoid nested functions Arnd Bergmann
2016-02-08 19:09 ` Jason Baron [this message]
2016-02-09 12:19 ` [tip:locking/core] locking/static_keys: Avoid " tip-bot for Arnd Bergmann

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=56B8E7D9.1080301@akamai.com \
    --to=jbaron@akamai.com \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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