From da8a2abe0f6de8117a55fa1ee914a72255293ea3 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Tue, 5 Apr 2016 23:25:51 -0700 Subject: [PATCH] Address meta_data style review --- src/daemon/meta_data.c | 5 +++-- src/target_set.c | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/daemon/meta_data.c b/src/daemon/meta_data.c index 03b1d263..b3f892a2 100644 --- a/src/daemon/meta_data.c +++ b/src/daemon/meta_data.c @@ -328,13 +328,14 @@ int meta_data_clone_merge (meta_data_t **dest, meta_data_t *orig) /* {{{ */ if (orig == NULL) return (0); - if(NULL == *dest) { + if (*dest == NULL) { *dest = meta_data_clone(orig); return(0); } pthread_mutex_lock (&orig->lock); - for(e=orig->head; NULL != e; e = e->next) { + for (e=orig->head; e != NULL; e = e->next) + { md_entry_insert_clone((*dest), e); } pthread_mutex_unlock (&orig->lock); diff --git a/src/target_set.c b/src/target_set.c index 99f8aa6a..73ca49fb 100644 --- a/src/target_set.c +++ b/src/target_set.c @@ -103,15 +103,17 @@ static int ts_config_add_meta (meta_data_t **dest, /* {{{ */ return (-1); } - if(NULL == (*dest)) { + if ((*dest) == NULL) + { // Create a new meta_data_t - if( NULL == (*dest = meta_data_create())) { + if ((*dest = meta_data_create()) == NULL) + { ERROR ("Target `set': failed to create a meta data for `%s'.", ci->key); return (-1); } } - return(meta_data_add_string (*dest, key, string)); + return (meta_data_add_string (*dest, key, string)); } /* }}} int ts_config_add_meta */ static int ts_destroy (void **user_data) /* {{{ */ @@ -237,7 +239,8 @@ static int ts_invoke (const data_set_t *ds, value_list_t *vl, /* {{{ */ return (-EINVAL); } - if(NULL != data->meta) { + if (data->meta != NULL) + { meta_data_clone_merge(&(vl->meta), data->meta); } -- 2.30.2