From 5dc561f1b49b4656ed0565cf0d8b43b4401ef879 Mon Sep 17 00:00:00 2001 From: Christopher Friedt Date: Tue, 28 Nov 2023 09:35:46 -0500 Subject: [PATCH] posix: key: remove unnecessary else / indent Remove the unnecessary else clause and indentation in pthread_setspecific(). Signed-off-by: Christopher Friedt --- lib/posix/key.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/posix/key.c b/lib/posix/key.c index 1a3f2b92a13..698088e340a 100644 --- a/lib/posix/key.c +++ b/lib/posix/key.c @@ -204,20 +204,17 @@ int pthread_setspecific(pthread_key_t key, const void *value) if (key_data == NULL) { retval = ENOMEM; goto out; - - } else { - /* Associate thread specific data, initialize new key */ - key_data->thread_data.key = key_obj; - key_data->thread_data.spec_data = (void *)value; - - /* Append new thread key data to thread's key list */ - sys_slist_append((&thread->key_list), - (sys_snode_t *)(&key_data->thread_data)); - - /* Append new key data to the key object's list */ - sys_slist_append(&(key_obj->key_data_l), - (sys_snode_t *)key_data); } + + /* Associate thread specific data, initialize new key */ + key_data->thread_data.key = key_obj; + key_data->thread_data.spec_data = (void *)value; + + /* Append new thread key data to thread's key list */ + sys_slist_append((&thread->key_list), (sys_snode_t *)(&key_data->thread_data)); + + /* Append new key data to the key object's list */ + sys_slist_append(&(key_obj->key_data_l), (sys_snode_t *)key_data); } out: