[PATCH] locking/static_keys: avoid nested functions

Jason Baron jbaron at akamai.com
Mon Feb 8 11:09:13 PST 2016


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

Works for me.

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

Thanks,

-Jason



More information about the linux-arm-kernel mailing list