Thread (2 messages) 2 messages, 2 authors, 2016-02-08

[PATCH] locking/static_keys: avoid nested functions

From: jbaron@akamai.com (Jason Baron)
Date: 2016-02-08 19:09:18
Also in: lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help